### Question:
LocationUtility implements GlobalPropertyListener { public static Location getDefaultLocation() { if (defaultLocation == null && Context.isSessionOpen()) { defaultLocation = Context.getLocationService().getDefaultLocation(); } return defaultLocation; }  static Location getDefaultLocation(); static Location getUserDefaultLocation(); static void setDefaultLocation(Location defaultLocation); @Override void globalPropertyChanged(GlobalProperty newValue); @Override void globalPropertyDeleted(String propertyName); @Override boolean supportsPropertyName(String propertyName);  }### Answer:
@Test public void getDefaultLocation_shouldReturnTheUpdatedDefaultLocationWhenTheValueOfTheGlobalPropertyIsChanged() { Assert.assertEquals("Unknown Location", LocationUtility.getDefaultLocation().getName()); GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME, "Xanadu", "Testing"); Context.getAdministrationService().saveGlobalProperty(gp); Assert.assertEquals("Xanadu", LocationUtility.getDefaultLocation().getName()); }
@Test @Verifies(value = "should return the updated defaultLocation when the value of the global property is changed", method = "getDefaultLocation()") public void getDefaultLocation_shouldReturnTheUpdatedDefaultLocationWhenTheValueOfTheGlobalPropertyIsChanged() throws Exception { Assert.assertEquals("Unknown Location", LocationUtility.getDefaultLocation().getName()); GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DEFAULT_LOCATION_NAME, "Xanadu", "Testing"); Context.getAdministrationService().saveGlobalProperty(gp); Assert.assertEquals("Xanadu", LocationUtility.getDefaultLocation().getName()); }