AreaParameters extends LineParameters { @Override public boolean equals(Object o){ if(o instanceof AreaParameters){ AreaParameters other = (AreaParameters) o; boolean sup = super.equals(other); return sup && this.fillColor.equals(other.fillColor) && this.fillOpacity.equals(other.fillOpacity); } else { return false; } } AreaParameters();  AreaParameters(Color lineCol,
                          Double lineOp,
                          Double lineWidth,
                          String lineDash,
                          Color fillCol,
                          Double fillOp); Color getFillColor(); Double getFillOpacity(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquality() throws Exception { AreaParameters ap = new AreaParameters(Color.BLUE, .25, 42.0, "2", Color.YELLOW, .46); AreaParameters ap2 = new AreaParameters(Color.BLUE, .25, 42.0, "2", Color.YELLOW, .46); assertTrue(ap.equals(ap2)); assertFalse(ap.equals("ahoi")); }
@Test public void testUniqueSymbolAreaInstanciation() throws Exception { AreaParameters ap = new AreaParameters(Color.BLUE, .25, 42.0, "2", Color.CYAN, .46); UniqueSymbolArea usa = new UniqueSymbolArea(ap); assertTrue(usa.getFillLegend().getColor().equals(Color.CYAN)); assertTrue(usa.getFillLegend().getOpacity() - .46 < EPS); assertTrue(usa.getStrokeLegend().getDashArray().equals("2")); assertTrue(usa.getStrokeLegend().getLineWidth() - 42.0 < EPS); assertTrue(usa.getStrokeLegend().getLineColor().equals(Color.BLUE)); assertTrue(usa.getStrokeLegend().getLineOpacity() - .25 < EPS); }
@Test public void testFromUniqueSymbolArea() throws Exception { AreaParameters ap = new AreaParameters(Color.BLUE, .25, 42.0, "2", Color.CYAN, .46); AreaParameters ap2 = new AreaParameters(Color.BLUE, .25, 42.0, "2", Color.CYAN, .46); UniqueSymbolArea usa = new UniqueSymbolArea(ap); assertTrue(ap2.equals(usa.getAreaParameters())); }