void () { var numbers = Arrays.asList("1a000001", "000001a1", "001a0001", "0001A001", "00001a01", "01a00001"); numbers.sort(NaturalComparator.INSTANCE); assertThat(numbers).containsExactly("1a000001", "01a00001", "001a0001", "0001A001", "00001a01", "000001a1"); var test = Arrays.asList("test011", "test10", "test10a", "test010"); test.sort(NaturalComparator.INSTANCE); assertThat(test).containsExactly("test10", "test10a", "test010", "test011"); var strings = Arrays.asList("Test99", "tes0", "test0", "testing", "test", "test99", "test011", "test1", "test 3", "test2", "test10a", "test10", "1.2.10.5", "1.2.9.1"); strings.sort(NaturalComparator.INSTANCE); assertThat(strings).containsExactly("1.2.9.1", "1.2.10.5", "tes0", "test", "test0", "test1", "test2", "test 3", "test10", "test10a", "test011", "Test99", "test99", "testing"); var strings2 = Arrays.asList("t1", "t001", "T2", "T002", "T1", "t2"); strings2.sort(NaturalComparator.INSTANCE); assertThat(strings2).containsExactly("T1", "t1", "t001", "T2", "t2", "T002"); assertThat(StringUtil.naturalCompare("7403515080361171695", "07403515080361171694")).isPositive(); assertThat(StringUtil.naturalCompare("_firstField", "myField1")).isNegative(); var strings3 = Arrays.asList("C148A_InsomniaCure", "C148B_Escape", "C148C_TersePrincess", "C148D_BagOfMice", "C148E_Porcelain"); strings3.sort(NaturalComparator.INSTANCE); assertThat(strings3).containsExactly("C148A_InsomniaCure", "C148B_Escape", "C148C_TersePrincess", "C148D_BagOfMice", "C148E_Porcelain"); var l = Arrays.asList("a0002", "a0 2", "a001"); l.sort(NaturalComparator.INSTANCE); assertThat(l).containsExactly("a0 2", "a001", "a0002"); }