I have a navigable set right now that stores Integers, how could I find the previous and next elements from a specific element? I'm not sure how to use an iterator if that's how you could find those elements.
Example:
NavigableSet<Integer> values = new TreeSet<>(List.of(1, 2, 3, 4, 5));
Lets say, given 3, I want to get hands on the 2 (previous) or the 4 (next).