### Question:
LdapTokenAttributeConversion { public static Entry stripObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute != null) { AttributeDescription description = attribute.getAttributeDescription(); entry.removeAttribute(description); } return entry; } @Inject  LdapTokenAttributeConversion(LDAPDataConversion conversion,
            LdapDataLayerConfiguration dataLayerConfiguration); Entry getEntry(Token token); Map<CoreTokenField, Object> mapFromEntry(Entry entry); Token tokenFromEntry(Entry entry); static Entry addObjectClass(Entry entry); static Entry stripObjectClass(Entry entry); DN generateTokenDN(Token token); DN generateTokenDN(String tokenId);  }### Answer:
@Test public void shouldNotStripObjectClassIfNotPresent() { Entry entry = mock(Entry.class); given(entry.getAttribute(anyString())).willReturn(null); LdapTokenAttributeConversion.stripObjectClass(entry); verify(entry, times(0)).removeAttribute(anyString(), any()); }
@Test public void shouldStripObjectClass() { Entry entry = mock(Entry.class); Attribute attribute = mock(Attribute.class); given(entry.getAttribute(anyString())).willReturn(attribute); AttributeDescription description = AttributeDescription.valueOf("badger"); given(attribute.getAttributeDescription()).willReturn(description); LdapTokenAttributeConversion.stripObjectClass(entry); verify(entry).removeAttribute(description); }