LineParameters implements SymbolParameters { @Override public boolean equals(Object o){ if(o instanceof LineParameters){ LineParameters bis = (LineParameters) o; return bis.getLineColor().equals(color) && bis.getLineWidth().equals(width) && bis.getLineDash().equals(dash) && bis.getLineOpacity().equals(opacity); } else { return false; } } LineParameters(Color c, Double op, Double w, String d); Color getLineColor(); Double getLineOpacity(); Double getLineWidth(); String getLineDash(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquality() throws Exception { LineParameters lp = new LineParameters(Color.BLUE,.4,2.0,"2 2"); LineParameters lp2 = new LineParameters(Color.BLUE,.4,2.0,"2 2"); assertTrue(lp.equals(lp2)); lp2 = new LineParameters(Color.BLUE,.4,2.0,"2 1 2"); assertFalse(lp.equals(lp2)); lp2 = new LineParameters(Color.BLUE,.4,3.0,"2 2"); assertFalse(lp.equals(lp2)); lp2 = new LineParameters(Color.BLUE,.5,2.0,"2 2"); assertFalse(lp.equals(lp2)); lp2 = new LineParameters(Color.YELLOW,.4,2.0,"2 2"); assertFalse(lp.equals(lp2)); }