@Test public void testEquals() { Context con = Context.newInstance("qa").build(); assertFalse(con.equals(null)); assertTrue(con.equals(con)); assertFalse(con.equals("qa")); Context con2 = Context.newInstance("Qa").build(); assertFalse(con.equals(con2)); assertTrue(con.equals(Context.from(con).build())); assertEquals(con.hashCode(), Context.from(con).build().hashCode()); }
@Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); }
Context { @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } }
Context { @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } private  Context(String ctx); protected  Context(); }
Context { @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } private  Context(String ctx); protected  Context(); static Context valueOf(String value); static Builder newInstance(String ctx); static Builder from(Context ctx); String getContext(); void setContext(String value); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
Context { @Override public boolean equals(Object obj) { return EqualsBuilder.reflectionEquals(this, obj); } private  Context(String ctx); protected  Context(); static Context valueOf(String value); static Builder newInstance(String ctx); static Builder from(Context ctx); String getContext(); void setContext(String value); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }