### Question:
LdapTokenAttributeConversion { public Entry getEntry(Token token) { Entry entry = new LinkedHashMapEntry(generateTokenDN(token)); addObjectClass(entry); for (CoreTokenField field : token.getAttributeNames()) { String key = field.toString(); if (CoreTokenField.TOKEN_TYPE.equals(field)) { TokenType type = token.getValue(field); entry.addAttribute(key, type.name()); continue; } if (CoreTokenFieldTypes.isCalendar(field)) { Calendar calendar = token.getValue(field); String dateString = conversion.toLDAPDate(calendar); entry.addAttribute(key, dateString); } else if (CoreTokenFieldTypes.isByteArray(field)) { byte[] array = token.getValue(field); entry.addAttribute(key, array); } else if (CoreTokenFieldTypes.isInteger(field)) { Integer value = token.getValue(field); entry.addAttribute(key, value); } else if (CoreTokenFieldTypes.isString(field)) { String value = token.getValue(field); if (!value.isEmpty()) { entry.addAttribute(key, value); } } else { throw new IllegalStateException(); } } 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 shouldHandleEmptyStrings() { Token token = new Token("id", TokenType.OAUTH); token.setAttribute(CoreTokenField.STRING_ONE, ""); LdapTokenAttributeConversion conversion = generateTokenAttributeConversion(); Entry result = conversion.getEntry(token); Attribute attribute = result.getAttribute(CoreTokenField.STRING_ONE.toString()); assertNull(attribute); }