static void ensureValidBindingContext(BindingContext bindingContext) { if (bindingContext == null) { throw new IllegalArgumentException("bindingContext must be not null"); } ensureExistingProperty(bindingContext, NORTH_BOUND); ensureExistingProperty(bindingContext, SOUTH_BOUND); ensureExistingProperty(bindingContext, WEST_BOUND); ensureExistingProperty(bindingContext, EAST_BOUND); PropertySet propertySet = bindingContext.getPropertySet(); final Double northBound = propertySet.getValue(NORTH_BOUND); final Double eastBound = propertySet.getValue(EAST_BOUND); final Double southBound = propertySet.getValue(SOUTH_BOUND); final Double westBound = propertySet.getValue(WEST_BOUND); if (northBound == null && eastBound == null && southBound == null && westBound == null) { setDefaultValues(bindingContext); } else if (!geoBoundsAreValid(northBound, eastBound, southBound, westBound)) { throw new IllegalArgumentException(MessageFormat.format("Given geo-bounds ({0}, {1}, {2}, {3}) are invalid.", northBound, eastBound, southBound, westBound)); } }