### Question:
MetadataDao extends NamedParameterJdbcDaoSupport { public List<String> loadUniqueValuesFromEntitiesAttribute(final AclClass entityClass, final String attributeKey) { return getNamedParameterJdbcTemplate().query(loadUniqueValuesFromEntitiesAttributes, MetadataParameters.getParametersForEntityAndKey(entityClass, attributeKey), MetadataParameters.getUniqueAttributesExtractor()); }  @Transactional(propagation = Propagation.MANDATORY) void registerMetadataItem(MetadataEntry metadataEntry); @Transactional(propagation = Propagation.MANDATORY) void uploadMetadataItemKey(EntityVO entityVO, String key, String value, String type); @Transactional(propagation = Propagation.MANDATORY) void uploadMetadataItem(MetadataEntry metadataEntry); @Transactional(propagation = Propagation.MANDATORY) void deleteMetadataItem(EntityVO entityVO); @Transactional(propagation = Propagation.MANDATORY) void deleteMetadataItemKey(EntityVO entityVO, String key); @Transactional(propagation = Propagation.MANDATORY) MetadataEntry deleteMetadataItemKeys(MetadataEntry metadataEntry, Set<String> keysToDelete); List<String> loadUniqueValuesFromEntitiesAttribute(final AclClass entityClass, final String attributeKey); MetadataEntry loadMetadataItem(EntityVO entity); boolean hasMetadata(EntityVO entity); List<MetadataEntry> loadMetadataItems(List<EntityVO> entities); List<MetadataEntryWithIssuesCount> loadMetadataItemsWithIssues(List<EntityVO> entities); List<EntityVO> searchMetadataByClassAndKeyValue(final AclClass entityClass,
                                                           final Map<String, PipeConfValue> indicator); List<CategoricalAttribute> buildFullMetadataDict(); static String convertDataToJsonStringForQuery(Map<String, PipeConfValue> data); Set<String> loadMetadataKeys(final AclClass entityClass); @Required void setLoadMetadataItemsWithIssuesQuery(String loadMetadataItemsWithIssuesQuery); @Required void setUploadMetadataItemKeyQuery(String uploadMetadataItemKeyQuery); @Required void setLoadMetadataItemQuery(String loadMetadataItemQuery); @Required void setLoadMetadataItemsQuery(String loadMetadataItemsQuery); @Required void setCreateMetadataItemQuery(String createMetadataItemQuery); @Required void setDeleteMetadataItemQuery(String deleteMetadataItemQuery); @Required void setDeleteMetadataItemKeyQuery(String deleteMetadataItemKeyQuery); @Required void setUploadMetadataItemQuery(String uploadMetadataItemQuery); @Required void setSearchMetadataByClassAndKeyValueQuery(String searchMetadataByClassAndKeyValueQuery); @Required void setLoadUniqueValuesFromEntitiesAttributes(final String loadUniqueValuesFromEntitiesAttributes); @Required void setCreateMetadataDictionary(final String createMetadataDictionary); @Required void setLoadMetadataKeysQuery(final String loadMetadataKeysQuery);  }### Answer:
@Test public void testLoadUniqueAttributes() { createMetadataForEntity(ID_1, CLASS_1, DATA_KEY_1, DATA_TYPE_1, DATA_VALUE_1); createMetadataForEntity(ID_2, CLASS_1, DATA_KEY_1, DATA_TYPE_1, DATA_VALUE_1); createMetadataForEntity(ID_3, CLASS_1, DATA_KEY_1, DATA_TYPE_1, DATA_VALUE_2); createMetadataForEntity(ID_4, CLASS_1, DATA_KEY_2, DATA_TYPE_1, DATA_VALUE_2); final List<String> uniqueAttributeValues = metadataDao.loadUniqueValuesFromEntitiesAttribute(CLASS_1, DATA_KEY_1); Assert.assertEquals(2, uniqueAttributeValues.size()); assertThat(uniqueAttributeValues, CoreMatchers.hasItems(DATA_VALUE_1, DATA_VALUE_2)); final List<String> emptyValues = metadataDao.loadUniqueValuesFromEntitiesAttribute(CLASS_1, NON_EXISTING_DATA_KEY); Assert.assertEquals(0, emptyValues.size()); }