### Question:
Token { public Collection<CoreTokenField> getAttributeNames() { Set<CoreTokenField> fields = new HashSet<CoreTokenField>(); for (Map.Entry<String, Object> entry : attributes.entrySet()) { CoreTokenField field = CoreTokenField.fromLDAPAttribute(entry.getKey()); if (entry.getValue() == null) { continue; } fields.add(field); } return Collections.unmodifiableSet(fields); } private  Token();  Token(String tokenId, TokenType type);  Token(Token copy); String getTokenId(); TokenType getType(); String getUserId(); void setUserId(String userId); Calendar getExpiryTimestamp(); void setExpiryTimestamp(Calendar expiryDate); byte[] getBlob(); void setBlob(byte[] data); Collection<CoreTokenField> getAttributeNames(); T getValue(CoreTokenField field); void setAttribute(CoreTokenField field, T value); void clearAttribute(CoreTokenField field); static boolean isFieldReadOnly(CoreTokenField field); @Override String toString();  }### Answer:
@Test public void shouldReturnAttributeNamesOnlyForSetAttributes() { Token token = new Token("id", TokenType.SESSION); Collection<CoreTokenField> fields = token.getAttributeNames(); assertEquals(fields.size(), 2); }