### Question:
ImmutableHeader implements Header { @Override public int hashCode() { return Objects. hash(this.name,this.rawValue,this.elements); } ImmutableHeader(String name, String rawValue, List<ImmutableElement> elements); @Override String name(); @Override String rawValue(); @Override ImmutableList<Element> elements(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testHashCodeEqualsContract$equal() throws Exception { ImmutableHeader sut = createHeader("header", "value"); ImmutableHeader other = createHeader("header", "value"); assertThat(sut,equalTo(other)); assertThat(sut.hashCode(),equalTo(other.hashCode())); }
@Test public void testHashCodeEqualsContract$differentHeader() throws Exception { ImmutableHeader sut = createHeader("header1", "value"); ImmutableHeader other = createHeader("header2", "value"); assertThat(sut,not(equalTo(other))); assertThat(sut.hashCode(),not(equalTo(other.hashCode()))); }
@Test public void testHashCodeEqualsContract$differentValue() throws Exception { ImmutableHeader sut = createHeader("header", "value1"); ImmutableHeader other = createHeader("header", "value2"); assertThat(sut,not(equalTo(other))); assertThat(sut.hashCode(),not(equalTo(other.hashCode()))); }
@Test public void testHashCodeEqualsContract$differentElements() throws Exception { ImmutableHeader sut = createHeader("header", "value",createElement("element1")); ImmutableHeader other = createHeader("header", "value",createElement("element2")); assertThat(sut,not(equalTo(other))); assertThat(sut.hashCode(),not(equalTo(other.hashCode()))); }