@Test public void classCastExceptionIsThrown_whenListContainsMapWithNoStringKeys() { final List<?> list = newArrayList(ImmutableMap.of(1, 2, 2, 3)); assertThatExceptionOfType(ClassCastException.class) .isThrownBy(() -> Events.ensureListOfOrderedMapOfStringsToObjects(list)); }
static List<Map<String, Object>> ensureListOfOrderedMapOfStringsToObjects(final List<?> list) { return list.stream().map(Map.class::cast).map(Events::ensureOrderedMapOfStringsToObjects).collect(toList()); }
Events { static List<Map<String, Object>> ensureListOfOrderedMapOfStringsToObjects(final List<?> list) { return list.stream().map(Map.class::cast).map(Events::ensureOrderedMapOfStringsToObjects).collect(toList()); } }
Events { static List<Map<String, Object>> ensureListOfOrderedMapOfStringsToObjects(final List<?> list) { return list.stream().map(Map.class::cast).map(Events::ensureOrderedMapOfStringsToObjects).collect(toList()); }  }
Events { static List<Map<String, Object>> ensureListOfOrderedMapOfStringsToObjects(final List<?> list) { return list.stream().map(Map.class::cast).map(Events::ensureOrderedMapOfStringsToObjects).collect(toList()); }   }
Events { static List<Map<String, Object>> ensureListOfOrderedMapOfStringsToObjects(final List<?> list) { return list.stream().map(Map.class::cast).map(Events::ensureOrderedMapOfStringsToObjects).collect(toList()); }    }