@Test public void testHashCodeEqualsContract$null() throws Exception { ImmutableElement sut = createElement("header"); assertThat(sut.equals(null),equalTo(false)); }
@Override public boolean equals(Object obj) { boolean result = false; if(obj instanceof Element) { Element that=(Element)obj; result= Objects.equals(this.name,that.name()) && Objects.equals(this.parameters,that.parameters()); } return result; }
ImmutableElement implements Element { @Override public boolean equals(Object obj) { boolean result = false; if(obj instanceof Element) { Element that=(Element)obj; result= Objects.equals(this.name,that.name()) && Objects.equals(this.parameters,that.parameters()); } return result; } }
ImmutableElement implements Element { @Override public boolean equals(Object obj) { boolean result = false; if(obj instanceof Element) { Element that=(Element)obj; result= Objects.equals(this.name,that.name()) && Objects.equals(this.parameters,that.parameters()); } return result; } ImmutableElement(String name, List<ImmutableElementParameter> parameters); }
ImmutableElement implements Element { @Override public boolean equals(Object obj) { boolean result = false; if(obj instanceof Element) { Element that=(Element)obj; result= Objects.equals(this.name,that.name()) && Objects.equals(this.parameters,that.parameters()); } return result; } ImmutableElement(String name, List<ImmutableElementParameter> parameters); @Override String name(); @Override ImmutableList<Parameter> parameters(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
ImmutableElement implements Element { @Override public boolean equals(Object obj) { boolean result = false; if(obj instanceof Element) { Element that=(Element)obj; result= Objects.equals(this.name,that.name()) && Objects.equals(this.parameters,that.parameters()); } return result; } ImmutableElement(String name, List<ImmutableElementParameter> parameters); @Override String name(); @Override ImmutableList<Parameter> parameters(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }