AdministrativeDivision implements AdministrativeEntity,GisFeature, CurrencyProvider { public AdministrativeEntity getAdministrativeEntity(int level) { return administrativeEntityLevelProvider().getAdministrativeEntity(level); } private  AdministrativeDivision(String name, String code, GisFeatureProvider gisFeatureProvider); static AdministrativeDivisionBuilder administrativeDivision(String name); String getName(); String getCode(); GisFeature getGisFeature(); AdministrativeEntity getParentEntity(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); int getAdminitrativeDivisionLevel(); AdministrativeEntity getParentAdministrativeEntity(); AdministrativeEntity getAdministrativeEntity(int level); Long getGeonamesId(); ImmutableSet<AlternateGisFeatureName> getGisFeatureAlternateNames(); String getGisFeatureDefaultName(); String getGisFeaturePreferredName(Iso639Language language); String getGisFeatureShortName(Iso639Language language); Country getCountry(); Long getElevation(); GisFeatureType getGisFeatureType(); Long getGtopo30AverageElevation(); DateTime getLastModificationDate(); double getLatitude(); Point getLocation(); double getLongitude(); Long getPopulation(); DateTimeZone getTimeZone(); Currency getCurrency(); ImmutableList<NamePart> getFullyQualifiedNameParts(); String getFriendlyCode();  }
@Test public void getAdministrativeEntityShouldReturnItselfWhenRequestedLevelIsCurrentLevel() { Assert.assertEquals(rambouilletAdm3(), rambouilletAdm3().getAdministrativeEntity(3)); }
@Test(expected=IllegalArgumentException.class) public void getAdministrativeEntityShouldThrowExceptionWhenRequestedLevelIsHigherThanCurrentLevel() { rambouilletAdm3().getAdministrativeEntity(4); }
@Test(expected=IllegalArgumentException.class) public void getAdministrativeEntityShouldNotAcceptLevelLowerThanZero() { rambouilletAdm3().getAdministrativeEntity(-1); }
@Test public void getAdministrativeEntityShouldWorkRecursivelyWhenRequestedLevelIsLowerThancurrentLevel() { Assert.assertEquals(ileDeFranceAdm1(), rambouilletAdm4().getAdministrativeEntity(1)); Assert.assertEquals(yvelinesAdm2(), rambouilletAdm4().getAdministrativeEntity(2)); Assert.assertEquals(rambouilletAdm3(), rambouilletAdm4().getAdministrativeEntity(3)); }