BinningFormModel { public Geometry getRegion() { if (Boolean.TRUE.equals(getPropertyValue(PROPERTY_KEY_GLOBAL))) { return toGeometry(GLOBAL_WKT); } else if (Boolean.TRUE.equals(getPropertyValue(PROPERTY_KEY_COMPUTE_REGION))) { return null; } else if (Boolean.TRUE.equals(getPropertyValue(PROPERTY_KEY_BOUNDS))) { final double westValue = getPropertyValue(PROPERTY_KEY_WEST_BOUND); final double eastValue = getPropertyValue(PROPERTY_KEY_EAST_BOUND); final double northValue = getPropertyValue(PROPERTY_KEY_NORTH_BOUND); final double southValue = getPropertyValue(PROPERTY_KEY_SOUTH_BOUND); Coordinate[] coordinates = { new Coordinate(westValue, southValue), new Coordinate(westValue, northValue), new Coordinate(eastValue, northValue), new Coordinate(eastValue, southValue), new Coordinate(westValue, southValue) }; final GeometryFactory geometryFactory = new GeometryFactory(); return geometryFactory.createPolygon(geometryFactory.createLinearRing(coordinates), null); } else if (Boolean.TRUE.equals(getPropertyValue(PROPERTY_KEY_MANUAL_WKT))) { return toGeometry((String) getPropertyValue(PROPERTY_KEY_WKT)); } throw new IllegalStateException("Should never come here"); } BinningFormModel(); PropertySet getPropertySet(); HashMap<String, Object> getParameterMap(); Product[] getSourceProducts(); String[] getSourceProductPath(); Product getContextProduct(); void useAsContextProduct(Product contextProduct); AggregatorConfig[] getAggregatorConfigs(); VariableConfig[] getVariableConfigs(); void setVariableConfigs(VariableConfig[] variableConfigs); Geometry getRegion(); String getMaskExpr(); BinningOp.TimeFilterMethod getTimeFilterMethod(); String getStartDateTime(); Double getPeriodDuration(); Double getMinDataHour(); int getSuperSampling(); int getNumRows(); void setProperty(String key, Object value); void addPropertyChangeListener(PropertyChangeListener propertyChangeListener); BindingContext getBindingContext();  }
@Test(expected = IllegalStateException.class) public void testGetRegion_Fail() throws Exception { final BinningFormModel binningFormModel = new BinningFormModel(); binningFormModel.getRegion(); }