VariableConfig { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; VariableConfig that = (VariableConfig) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (expr != null ? !expr.equals(that.expr) : that.expr != null) return false; return validExpr != null ? validExpr.equals(that.validExpr) : that.validExpr == null; } VariableConfig();  VariableConfig(String name, String expr);  VariableConfig(String name, String expr, String validExpr); String getName(); void setName(String name); String getExpr(); void setExpr(String expr); String getValidExpr(); void setValidExpr(String validExpr); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals_identity() { assertTrue(config.equals(config)); }
@Test public void testEquals_wrongClass() { assertFalse(config.equals(new Double(4))); }
@Test public void testEquals_nullInput() { assertFalse(config.equals(null)); }