@Test public void testEquals() { assertEquals(new Header("k", "v"), new Header("k", "v")); assertNotEquals(new Header("k", "v"), new Header("k", "f")); assertNotEquals(new Header("k", "v"), new Header("m", "v")); }
@Override public boolean equals(final Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } final Header header = (Header) o; if(!Objects.equals(name, header.name)) { return false; } if(!Objects.equals(value, header.value)) { return false; } return true; }
Header implements Comparable<Header> { @Override public boolean equals(final Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } final Header header = (Header) o; if(!Objects.equals(name, header.name)) { return false; } if(!Objects.equals(value, header.value)) { return false; } return true; } }
Header implements Comparable<Header> { @Override public boolean equals(final Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } final Header header = (Header) o; if(!Objects.equals(name, header.name)) { return false; } if(!Objects.equals(value, header.value)) { return false; } return true; } Header(String name, String value); }
Header implements Comparable<Header> { @Override public boolean equals(final Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } final Header header = (Header) o; if(!Objects.equals(name, header.name)) { return false; } if(!Objects.equals(value, header.value)) { return false; } return true; } Header(String name, String value); String getName(); void setName(String name); String getValue(); void setValue(String value); @Override int compareTo(Header o); @Override boolean equals(final Object o); @Override int hashCode(); }
Header implements Comparable<Header> { @Override public boolean equals(final Object o) { if(this == o) { return true; } if(o == null || getClass() != o.getClass()) { return false; } final Header header = (Header) o; if(!Objects.equals(name, header.name)) { return false; } if(!Objects.equals(value, header.value)) { return false; } return true; } Header(String name, String value); String getName(); void setName(String name); String getValue(); void setValue(String value); @Override int compareTo(Header o); @Override boolean equals(final Object o); @Override int hashCode();  }