Articles, dummyCategory

Convert String to Title Case in Java – HowToDoInJava

Java examples to convert a string to title case using Apache commons WordUtils class, String.split() method and Java 8 stream of character array. 1. Using WordUtils from Apache Commons Text Apache commons-text provides WordUtils to perform operations on String that contains words. 1.1. Maven dependency 1.2. WordUtils example to convert string to title case Program …

Articles, Home

Java group by sort with multiple comparators – HowToDoInJava

Java examples to do SQL-style group by sort on list of objects. It involves using multiple comparators, each of which is capable of sorting on different field in model object. Table of Contents 1. Model class and multiple comparators 2. Comparator.thenComparing() 3. CompareToBuilder 4. ComparisonChain 5. Chained comparators 1. Model class and multiple comparators Our …