void (String[] args) { List<SortedMap<String, Double>> results = codeUnderTest(); assertThat(results, contains(Stream.of(entry("A", 1.0), entry("B", 2.0), entry("C", 3.0)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> a, TreeMap::new)))); System.out.println("ok!"); }