### Question:
AbstractLocation extends AbstractBrooklynObject implements LocationInternal, HasHostGeoInfo, Configurable { @Override public boolean containsLocation(Location potentialDescendent) { Location loc = potentialDescendent; while (loc != null) { if (this == loc) return true; loc = loc.getParent(); } return false; } AbstractLocation();  AbstractLocation(Map<?,?> properties); void setManagementContext(ManagementContextInternal managementContext); @SuppressWarnings("serial") @Override @Deprecated AbstractLocation configure(Map<?,?> properties); boolean isManaged(); void onManagementStarted(); void onManagementStopped(); @Override String getDisplayName(); @Override Location getParent(); @Override Collection<Location> getChildren(); @Override void setParent(Location newParent); void setParent(Location newParent, boolean updateChildListParents); @Override ConfigurationSupportInternal config(); @Override @Beta BasicSubscriptionSupport subscriptions(); @Override T getConfig(HasConfigKey<T> key); @Override T getConfig(ConfigKey<T> key); @Override @Deprecated boolean hasConfig(ConfigKey<?> key, boolean includeInherited); @Override @Deprecated Map<String,Object> getAllConfig(boolean includeInherited); @Override @Deprecated ConfigBag getAllConfigBag(); @Override ConfigBag getLocalConfigBag(); @Deprecated ConfigBag getRawLocalConfigBag(); @Override @Deprecated T setConfig(ConfigKey<T> key, T value); @Deprecated void setName(String newName); void setDisplayName(String newName); @Override boolean equals(Object o); @Override int hashCode(); @Override boolean containsLocation(Location potentialDescendent); @SuppressWarnings("deprecation") void addChild(Location child); boolean removeChild(Location child); @Override String toString(); @Override String toVerboseString(); @Override HostGeoInfo getHostGeoInfo(); void setHostGeoInfo(HostGeoInfo hostGeoInfo); @Override RebindSupport<LocationMemento> getRebindSupport(); @SuppressWarnings("unchecked") @Override RelationSupportInternal<Location> relations(); @Override boolean hasExtension(Class<?> extensionType); @Override @SuppressWarnings("unchecked") T getExtension(Class<T> extensionType); @Override void addExtension(Class<T> extensionType, T extension); @Override Map<String, String> toMetadataRecord(); @Deprecated
    static final Logger LOG; static final ConfigKey<Location> PARENT_LOCATION; static final ConfigKey<Boolean> TEMPORARY_LOCATION; }### Answer:
@Test public void testContainsLocation() { Location location = createConcrete(); Location locationSub = createConcrete(); locationSub.setParent(location); assertTrue(location.containsLocation(location)); assertTrue(location.containsLocation(locationSub)); assertFalse(locationSub.containsLocation(location)); }