@Test public void testFieldValidation() throws Exception { Map value = new ObjectMapper().readValue(getClass().getResourceAsStream("nested.json"), Map.class); Field fl = Field.parseField(value); List<String>[] findFixes = MappingUtils.findTypos(Collections.singletonList("nam"), fl); assertThat(findFixes[1], contains("name")); findFixes = MappingUtils.findTypos(Collections.singletonList("link.url"), fl); assertThat(findFixes[1], contains("links.url")); findFixes = MappingUtils.findTypos(Collections.singletonList("ulr"), fl); assertThat(findFixes[1], contains("links.url")); findFixes = MappingUtils.findTypos(Collections.singletonList("likn"), fl); assertThat(findFixes[1], contains("links")); findFixes = MappingUtils.findTypos(Collections.singletonList("_uid"), fl); assertThat(findFixes, is(nullValue())); }