@Test public void equals() { assertEquals("same", NameValuePair.of("x", "y"), NameValuePair.of("x", "y")); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !NameValuePair.class.isAssignableFrom(o.getClass())) return false; NameValuePair that = (NameValuePair) o; return Objects.equals(name, that.getName()) && Objects.equals(value, that.getValue()); }
NameValuePairImpl implements NameValuePair { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !NameValuePair.class.isAssignableFrom(o.getClass())) return false; NameValuePair that = (NameValuePair) o; return Objects.equals(name, that.getName()) && Objects.equals(value, that.getValue()); } }
NameValuePairImpl implements NameValuePair { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !NameValuePair.class.isAssignableFrom(o.getClass())) return false; NameValuePair that = (NameValuePair) o; return Objects.equals(name, that.getName()) && Objects.equals(value, that.getValue()); } NameValuePairImpl(String name, String value); }
NameValuePairImpl implements NameValuePair { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !NameValuePair.class.isAssignableFrom(o.getClass())) return false; NameValuePair that = (NameValuePair) o; return Objects.equals(name, that.getName()) && Objects.equals(value, that.getValue()); } NameValuePairImpl(String name, String value); @Override String getName(); @Override String getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
NameValuePairImpl implements NameValuePair { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !NameValuePair.class.isAssignableFrom(o.getClass())) return false; NameValuePair that = (NameValuePair) o; return Objects.equals(name, that.getName()) && Objects.equals(value, that.getValue()); } NameValuePairImpl(String name, String value); @Override String getName(); @Override String getValue(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }