CategorizedReal extends CategorizedLegend<Double> { @Override public Double getFromLower(Double d){ if(d==null){ throw new NullPointerException("The input threshold must not be null"); } if(parameter instanceof RealLiteral){ return ((RealLiteral) parameter).getValue(null); } else { Double col = get(d); if(col == null){ Categorize2Real c2s = (Categorize2Real) parameter; Map<String,Object> inp = new HashMap<>(); inp.put(getField(), d); try { return c2s.getValue(inp); } catch (ParameterException e) { throw new IllegalStateException("May this categorize need many fields ?"); } } else { return col; } } } CategorizedReal(RealParameter sp); @Override SeParameter getParameter(); void setParameter(RealParameter param); Double getFallbackValue(); void setFallbackValue(Double value); @Override Double get(Double d); @Override void put(Double d, Double v); @Override Double remove(Double d); @Override Double getFromLower(Double d);  }
@Test public void testGetFromLower() throws Exception { CategorizedReal cs = new CategorizedReal(getCategorize2Real()); assertTrue(cs.getFromLower(25.0).equals(24.0)); }