### Question:
StudyEJB3DAO extends AccessibleEJB3DAO<Study> implements StudyDAO { public void changeStudyStatus(String acc, VisibilityStatus status) { Query query = entityManager.createQuery("UPDATE Study s SET " + "s.status =:status " + "WHERE s.acc =:acc") .setParameter("status", status) .setParameter("acc", acc); int updatedStudies = query.executeUpdate(); } StudyEJB3DAO();  StudyEJB3DAO(EntityManager entityManager); List<Property<FactorValue>> getFactorsForStudy(Long studyId); List<Property<CharacteristicValue>> getCharacteristicsForStudy(Long studyId); List<PropertyValue> getValuesOfPropertyForStudyId(Long studyId, String propertyName); List<PropertyValue> getValuesOfPropertyForStudyAcc(String studyAcc, String propertyName); List<String> filterByOntologyTermAndRefAcc(String termAcc, String refSourceAcc); List<String> filterByOntologyTermAndRefName(String termAcc, String refSourceName); List<String> filterFactorsByOntologyTermAndRefName(String termAcc, String refSourceName); List<String> filterFactorsByOntologyTermAndRefNameForUser(String termAcc, String refSourceName, String userName); boolean studyExists(String acc); List<String> getAllStudyAccs(); List<Study> getStudiesByContact(Contact contact); List<Study> getStudiesByContactLastName(String lastName); List<Study> getStudiesByContactEmail(String email); List<Study> getStudiesByContactAffiliation(String affiliation); List<Study> getStudiesByPubmedIdOrDoi(String id); List<Study> getStudiesByProperty(PropertyValuesWS property); List<Study> getStudiesByAssayType(AssayTypeWS assayType); List<String> getPublicStudyAccs(); List<String> getStudyAccForUser(String userName); List<String> getOwnedStudiesForUser(String userName); Study getByAccForUser(String acc, String userName); void changeStudyStatus(String acc, VisibilityStatus status); Map<String, VisibilityStatus> getVisibilityStatusForStudies(); void addUserToStudy(String acc, User user); void removeUserFromStudy(String acc, User user);  }### Answer:
@Test public void testChangeStudyStatus() throws Exception { Study study = dao.getByAcc("BII-ST-1"); assertEquals(VisibilityStatus.PRIVATE, study.getStatus()); EntityTransaction tnx = entityManager.getTransaction(); tnx.begin(); dao.changeStudyStatus("BII-ST-1", VisibilityStatus.PUBLIC); tnx.commit(); entityManager.clear(); Study study1 = dao.getByAcc("BII-ST-1"); assertEquals(VisibilityStatus.PUBLIC, study1.getStatus()); tnx = entityManager.getTransaction(); tnx.begin(); dao.changeStudyStatus("BII-ST-2", VisibilityStatus.PRIVATE); tnx.commit(); study1 = dao.getByAcc("BII-ST-2"); assertEquals(VisibilityStatus.PRIVATE, study1.getStatus()); }