Hello I was wondering if somebody could help me with a little bit of code I'm stuck on. So I'm writing a custom comparator using lambda statements I want to do the following. If the names that return of .getName() equals to each other then I want to pick the one that is the String "Up" from .getDirection() (Its guaranteed one of them is "Up" in that case, the other is "Down"), else we will look at which one is alphabetically higher depending on the .getType().
So far I have this:
(x,y) -> x.getName().equals(y.getName()) ? //confused part : x.getType().compareTo(y.getType) );
Any help would be appreciated, thank you.