@Test public void testEquals() throws Exception { PdpAttribute attr1 = new PdpAttribute("some_name", "some_value"); PdpAttribute attr2 = new PdpAttribute("some_name", "some_value"); assertEquals(attr1, attr2); assertEquals(1, new HashSet<>(Arrays.asList(attr1, attr2)).size()); String s = attr1.toString(); assertTrue(s.contains("some_name")); assertTrue(s.contains("some_value")); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PdpAttribute that = (PdpAttribute) o; return Objects.equals(name, that.name) && Objects.equals(value, that.value); }
PdpAttribute { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PdpAttribute that = (PdpAttribute) o; return Objects.equals(name, that.name) && Objects.equals(value, that.value); } }
PdpAttribute { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PdpAttribute that = (PdpAttribute) o; return Objects.equals(name, that.name) && Objects.equals(value, that.value); } PdpAttribute();  PdpAttribute(String name, String value); }
PdpAttribute { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PdpAttribute that = (PdpAttribute) o; return Objects.equals(name, that.name) && Objects.equals(value, that.value); } PdpAttribute();  PdpAttribute(String name, String value); String getName(); void setName(String name); String getValue(); void setValue(String value); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PdpAttribute { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PdpAttribute that = (PdpAttribute) o; return Objects.equals(name, that.name) && Objects.equals(value, that.value); } PdpAttribute();  PdpAttribute(String name, String value); String getName(); void setName(String name); String getValue(); void setValue(String value); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }