### Question:
DBRepositoryManager implements RepositoryManager { @Override public final void updateRepository(final Repository<?> repository) { repositoryDBManager.update(repository); } DBRepositoryManager(final SessionFactory sessionFactory); @Override final Repository<?> getRepository(final String name); final Repository<?> getRepository(final Serializable id); @Override final List<Repository> getRepositoryList(final Class<? extends Repository> clazz); @Override final Repository<?> saveRepository(final Repository<?> repository); @Override final void updateRepository(final Repository<?> repository); @Override final boolean deleteRepository(final Repository<?> repository); @Override final RepoPackage getRepoPackage(final Serializable id); @Override final RepoPackage saveRepoPackage(final RepoPackage repoPackage);  }### Answer:
@Test public final void testUpdateRepository() throws IOException { DBRepositoryManager repoMan = new DBRepositoryManager(sessionFactory); Repository savedRepo = repoMan.saveRepository(getTestRepository()); RepoPackage repoPackage = getTestRepoPackage(savedRepo); Set<IMABaselineRecord> measurements = new HashSet<>(); measurements.add(getTestIMABaselineRecord()); repoPackage.setAllMeasurements(measurements, RepoPackageTest.getTestDigest()); repoMan.saveRepoPackage(repoPackage); Repository repositoryWithPackage = repoMan.getRepository(savedRepo.getId()); RepoPackage newRepoPackage = new RPMRepoPackage(repoPackage.getName(), "2.0", repoPackage.getRelease(), repoPackage.getArchitecture(), repoPackage.getSourceRepository() ); measurements.clear(); measurements.add(getTestIMABaselineRecord()); newRepoPackage.setAllMeasurements(measurements, RepoPackageTest.getTestDigest()); repoMan.saveRepoPackage(newRepoPackage); repositoryWithPackage.setName("New name"); repoMan.updateRepository(repositoryWithPackage); repositoryWithPackage = repoMan.getRepository(savedRepo.getId()); Assert.assertEquals(repositoryWithPackage.getName(), "New name"); Assert.assertEquals(repositoryWithPackage.getPackages().size(), 2); }