Fix LegacyRepositoryUnitTest.java.
Add unit test for repository takeover.