### Question:
OnmsMapDaoHibernate extends AbstractDaoHibernate<OnmsMap, Integer> implements OnmsMapDao { public Collection<OnmsMap> findVisibleMapsByGroup(String group) { Object[] values = {OnmsMap.ACCESS_MODE_ADMIN, OnmsMap.ACCESS_MODE_USER,OnmsMap.ACCESS_MODE_GROUP,group}; return find("from OnmsMap as map where map.accessMode = ? or map.accessMode = ? or " + "(map.accessMode = ? and map.mapGroup = ?)", values); } OnmsMapDaoHibernate(); @SuppressWarnings("unchecked") Collection<OnmsMap> findAll(final Integer offset, final Integer limit); Collection<OnmsMap> findMapsLike(String mapLabel); Collection<OnmsMap> findMapsByName(String mapLabel); OnmsMap findMapById(int id); Collection<OnmsMap> findMapsByNameAndType(String mapName, String mapType); Collection<OnmsMap> findMapsByType(String mapType); Collection<OnmsMap> findAutoMaps(); Collection<OnmsMap> findUserMaps(); Collection<OnmsMap> findSaveMaps(); Collection<OnmsMap> findMapsByGroup(String group); Collection<OnmsMap> findMapsByOwner(String owner); Collection<OnmsMap> findVisibleMapsByGroup(String group); Collection<OnmsMap> findAutoAndSaveMaps(); int updateAllAutomatedMap(final Date time);  }### Answer:
@Test @Transactional public void testFindVisibleMapByGroup() { OnmsMap map = new OnmsMap("onmsMapDaoHibernateTestVisibleMap", "admin",OnmsMap.ACCESS_MODE_GROUP, 969,726); map.setMapGroup("testGroup"); m_onmsMapDao.save(map); m_onmsMapDao.flush(); m_onmsMapDao.clear(); Collection<OnmsMap> maps = m_onmsMapDao.findVisibleMapsByGroup("testGroup"); assertEquals(2, maps.size()); }
@Test @Transactional public void testFindVisibleMapByGroup2() { OnmsMap map = new OnmsMap("onmsMapDaoHibernateTestVisibleMap", "admin",OnmsMap.ACCESS_MODE_GROUP, 969,726); map.setMapGroup("testGroup"); m_onmsMapDao.save(map); m_onmsMapDao.flush(); m_onmsMapDao.clear(); Collection<OnmsMap> maps = m_onmsMapDao.findVisibleMapsByGroup("wrongGroup"); assertEquals(1, maps.size()); }