### Question:
HibernateAttributeSetDAO extends HibernatePersistentObjectDAO<AttributeSet> implements AttributeSetDAO { @Override public Map<String, Attribute> findAttributes(long tenantId, Long setId) { List<AttributeSet> sets = new ArrayList<AttributeSet>(); if (setId != null) sets.add(findById(setId)); else sets.addAll(findAll(tenantId)); Map<String, Attribute> attributes = new TreeMap<String, Attribute>(); for (AttributeSet set : sets) { initialize(set); Map<String, Attribute> localAttributes = set.getAttributes(); for (String name : localAttributes.keySet()) if (!attributes.containsKey(name)) attributes.put(name, localAttributes.get(name)); } return attributes; } HibernateAttributeSetDAO(); @Override List<AttributeSet> findAll(); @Override List<AttributeSet> findAll(long tenantId); @Override AttributeSet findByName(String name, long tenantId); @Override boolean delete(long id, int code); @Override List<AttributeSet> findByType(int type, long tenantId); void setOptionsDao(AttributeOptionDAO optionsDao); @Override boolean store(AttributeSet set); void setTemplateDao(TemplateDAO templateDao); @Override Map<Long, AttributeSet> load(long tenantId); @Override Map<String, Attribute> findAttributes(long tenantId, Long setId);  }### Answer:
@Test public void testFindAttributes() { Map<String, Attribute> attributes = dao.findAttributes(1L, null); Assert.assertEquals(9, attributes.size()); Assert.assertTrue(attributes.containsKey("sourceAuthor")); }