### Question:
UpgradeDAO { @RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); }  @RequiresSession List<UpgradeEntity> findAll(); @RequiresSession List<UpgradeEntity> findUpgrades(long clusterId); @RequiresSession UpgradeEntity findUpgrade(long upgradeId); @RequiresSession UpgradeEntity findUpgradeByRequestId(Long requestId); @Transactional void create(UpgradeEntity entity); @Transactional void removeAll(long clusterId); @RequiresSession UpgradeGroupEntity findUpgradeGroup(Long groupId); @RequiresSession UpgradeItemEntity findUpgradeItemByRequestAndStage(Long requestId, Long stageId); @RequiresSession UpgradeEntity findLastUpgradeForCluster(long clusterId, Direction direction); @RequiresSession UpgradeEntity findLastUpgradeOrDowngradeForCluster(long clusterId); @RequiresSession UpgradeEntity findRevertable(long clusterId); @RequiresSession UpgradeEntity findRevertableUsingJPQL(long clusterId); @Transactional UpgradeEntity merge(UpgradeEntity upgradeEntity);  }### Answer:
@Test public void testFindForCluster() throws Exception { List<UpgradeEntity> items = dao.findUpgrades(clusterId.longValue()); assertEquals(1, items.size()); }