### Question:
AbstractLocation implements Location { @Override public boolean hasName(String name, Set<Language> languages) { Validate.notNull(name, "name must not be null"); Validate.notNull(languages, "languages must not be null"); if (equalName(getPrimaryName(), name)) { return true; } for (AlternativeName alternativeName : getAlternativeNames()) { String currentName = alternativeName.getName(); Language currentLang = alternativeName.getLanguage(); if (equalName(currentName, name) && (currentLang == null || languages.contains(currentLang))) { return true; } } return false; }  @Override final boolean descendantOf(Location other); @Override final boolean childOf(Location other); @Override final boolean commonName(Location other); @Override final Set<String> collectAlternativeNames(); @Override @Deprecated final Double getLatitude(); @Override @Deprecated final Double getLongitude(); @Override String toString(); @Override boolean hasName(String name, Set<Language> languages); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testHasName() { assertFalse(l3.hasName("New York", EnumSet.of(Language.ITALIAN))); assertTrue(l3.hasName("New York", EnumSet.of(Language.ENGLISH))); assertTrue(l3.hasName("new york", EnumSet.of(Language.ENGLISH))); assertTrue(l3.hasName("New York City", EnumSet.of(Language.GERMAN))); assertTrue(l3.hasName("New York City", EnumSet.of(Language.ENGLISH))); assertTrue(l3.hasName("new york city", EnumSet.of(Language.ENGLISH))); }