Found a possible solution:
Comparator.comparing(ToSort::getSortBy,
Comparator.nullsFirst(Comparator.naturalOrder())
)
More Related Contents:
- Comparator.reversed() does not compile using lambda
- Very confused by Java 8 Comparator type inference
- Reverse a comparator in Java 8
- comparing and thenComparing gives compile error
- Comparator.comparing(…) of a nested field
- PermGen elimination in JDK 8
- How to install Java 8 on Mac
- Is method reference caching a good idea in Java 8?
- UnsupportedTemporalTypeException when formatting Instant to String
- How to convert a Java 8 Stream to an Array?
- How to sum a list of integers with java streams?
- Why does Stream not implement Iterable?
- In Java 8, is there a ByteStream class?
- LambdaConversionException with generics: JVM bug?
- What’s the difference between instance method reference types in Java 8?
- functional interface that takes nothing and returns nothing [duplicate]
- When I need to use Optional.orElseGet() over Optional.orElse()
- Equivalent of Scala dropWhile
- Why does Stream.allMatch() return true for an empty stream?
- What does comparison being consistent with equals mean ? What can possibly happen if my class doesn’t follow this principle?
- What Java 8 Stream.collect equivalents are available in the standard Kotlin library?
- Implement recursive lambda function using Java 8
- Proper usage of Optional.ifPresent()
- Java 8 LocalDate – How do I get all dates between two dates?
- Please Explain Java 8 Method Reference to instance Method using class name
- NoClassDefFoundError sun/io/ByteToCharConverter with InterBase JDBC driver
- Default garbage collector for Java 8
- Purpose of third argument to ‘reduce’ function in Java 8 functional programming
- Create a SortedMap in Java with a custom Comparator
- How to get multiple values from an object using a single stream operation?