LdapAttribute { @Override public boolean equals(final Object o) { if (o == this) { return true; } if (o instanceof LdapAttribute) { final LdapAttribute v = (LdapAttribute) o; return LdapUtils.areEqual( attributeName != null ? attributeName.toLowerCase() : null, v.attributeName != null ? v.attributeName.toLowerCase() : null) && LdapUtils.areEqual(attributeValues, v.attributeValues); } return false; } LdapAttribute();  LdapAttribute(final String type);  LdapAttribute(final String type, final byte[]... value);  LdapAttribute(final String type, final String... value); void setName(final String type); boolean isBinary(); void setBinary(final boolean b); void configureBinary(final String... attrNames); String getName(); String getName(final boolean withOptions); List<String> getOptions(); byte[] getBinaryValue(); Collection<byte[]> getBinaryValues(); String getStringValue(); Collection<String> getStringValues(); T getValue(final Function<byte[], T> func); Collection<T> getValues(final Function<byte[] , T> func); void addBinaryValues(final byte[]... value); void addBinaryValues(final Collection<byte[]> values); void addStringValues(final String... value); void addStringValues(final Collection<String> values); void addBufferValues(final ByteBuffer... values); void addBufferValues(final Collection<ByteBuffer> values); @SuppressWarnings("unchecked") void addValues(final Function<T, byte[]> func, final T... value); void addValues(final Function<T, byte[]> func, final Collection<T> values); void removeBinaryValues(final byte[]... value); void removeBinaryValues(final Collection<byte[]> values); void removeStringValues(final String... value); void removeStringValues(final Collection<String> values); void removeBufferValues(final ByteBuffer... values); void removeBufferValues(final Collection<ByteBuffer> values); int size(); void clear(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static LdapAttribute sort(final LdapAttribute la); static String escapeValue(final String value); static Builder builder();  }
@Test public void testEquals() { final LdapAttribute la1 = LdapAttribute.builder().build(); Assert.assertEquals(la1, la1); Assert.assertEquals(LdapAttribute.builder().build(), LdapAttribute.builder().build()); Assert.assertEquals( LdapAttribute.builder().name("uid").values("1").build(), LdapAttribute.builder().name("uid").values("1").build()); Assert.assertEquals( LdapAttribute.builder().name("uid").values("1").binary(true).build(), LdapAttribute.builder().name("uid").values("1").binary(true).build()); Assert.assertEquals( LdapAttribute.builder().name("uid").values("1").binary(true).build(), LdapAttribute.builder().name("uid").values("1").binary(false).build()); Assert.assertEquals( LdapAttribute.builder().name("uid").values("1", "2", "3").build(), LdapAttribute.builder().name("uid").values("1", "2", "3").build()); Assert.assertNotEquals( LdapAttribute.builder().name("uuid").values("1").build(), LdapAttribute.builder().name("uid").values("1").build()); Assert.assertNotEquals( LdapAttribute.builder().name("uid").values("2").build(), LdapAttribute.builder().name("uid").values("1").build()); Assert.assertNotEquals( LdapAttribute.builder().name("uid").values("1", "2", "3" , "4").build(), LdapAttribute.builder().name("uid").values("1", "2", "3").build()); }