Sorting ArrayList with Lambda in Java 8 May 5, 2023 by Tarik For strings this would work arrayList.sort((p1, p2) -> p1.compareTo(p2));