### Question:
LdapTokenAttributeConversion { public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } 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 shouldNotAddObjectClassIfPresent() { Entry entry = mock(Entry.class); Attribute attribute = mock(Attribute.class); given(entry.getAttribute(anyString())).willReturn(attribute); LdapTokenAttributeConversion.addObjectClass(entry); verify(entry, times(0)).addAttribute(anyString(), any()); }
@Test public void shouldAddObjectClass() { Entry entry = mock(Entry.class); given(entry.getAttribute(anyString())).willReturn(null); LdapTokenAttributeConversion.addObjectClass(entry); verify(entry).addAttribute(anyString(), any()); }