CategorizedLine extends AbstractCategorizedLegend<LineParameters> { @Override public LineParameters remove(Object o) { if(!(o instanceof Double)){ throw new IllegalArgumentException("Keys are double values in this map"); } Double d = (Double)o; forceMapping(d); LineParameters ret = null; if(containsKey(d)){ ret = get(d); } color.remove(d); opacity.remove(d); width.remove(d); dash.remove(d); return ret; } CategorizedLine();  CategorizedLine(LineSymbolizer ls); @Override List<CategorizedLegend> getCategorizedLegend(); @Override void setFallbackParameters(LineParameters fallback); @Override LineParameters getFallbackParameters(); @Override Symbolizer getSymbolizer(); @Override String getLegendTypeName(); @Override LineParameters get(Object o); @Override LineParameters put(Double d, LineParameters lp); @Override LineParameters remove(Object o); @Override Uom getStrokeUom(); @Override void setStrokeUom(Uom u); @Override String getLegendTypeId(); static final String NAME; }
@Test public void testRemove() throws Exception { CategorizedLine cl = getCategorizedLine(); LineParameters lp = cl.remove(70000.0); assertTrue(lp.equals(new LineParameters(Color.decode("#dd66ee"),.75,1.0 ,"2 2"))); assertTrue(cl.get(Double.NEGATIVE_INFINITY).equals(new LineParameters(Color.decode("#113355"),.75,.5,"2 2"))); assertTrue(cl.get(80000.0 ).equals(new LineParameters(Color.decode("#dd66ee"),.75,1.25,"2 2"))); assertTrue(cl.get(100000.0).equals(new LineParameters(Color.decode("#ffaa99"),.75,1.5 ,"2 2"))); }