Java - headMap, tailMap and subMap in NavigableMap
NavigableMap collection on Java provide methods to return the view of Map on sorted order of key. The most common methods are headMap, tailMap and subMap. he...
NavigableMap collection on Java provide methods to return the view of Map on sorted order of key. The most common methods are headMap, tailMap and subMap. he...
Guava example 1 2 3 Collection.sort(list, Ordering.from((Comparator<Item>) Comparator.comparingInt(item -> item.getId())) .compound(Comparat...
Example of a chained comparison statement. 1 2 3 4 5 6 7 public int compareTo(Foo that) { return ComparisonChain.start() .compare(this.aStri...
The following article is explaining the under the hood Java 8 Stream API. https://www.ibm.com/developerworks/library/j-java-streams-3-brian-goetz/index.html
1 2 3 4 5 6 7 8 Statement stmt = QueryBuilder().select().all().from('table'); ResultSet rs = session.execute(stmt); StreamSupport.stream( Spliterators.sp...