void () { assertThat(OSAgnosticPathUtil.COMPARATOR.compare("", "")).isEqualTo(0); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/", "")).isPositive(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("", "\\")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/", Character.toString('/'))).isEqualTo(0); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("//", "\\\\")).isEqualTo(0); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b", "\\a\\b")).isEqualTo(0); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("a", "b")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("b", "a")).isPositive(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b", "\\a\\b\\")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b", "/a/b/c")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b", "/a/bc")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b", "/a/b.c")).isNegative(); assertThat(OSAgnosticPathUtil.COMPARATOR.compare("/a/b/c", "/a/b.c")).isNegative(); List<String> paths = Arrays.asList("/a/bC", "/a/b-c", "/a/b", "/a/b/c", null); Collections.shuffle(paths); Collections.sort(paths, OSAgnosticPathUtil.COMPARATOR); assertThat(paths).containsExactly(null, "/a/b", "/a/b/c", "/a/b-c", "/a/bC"); }