### Question:
ArchivaRepositoryRegistry implements ConfigurationListener, EventHandler<Event>,
    RepositoryRegistry { @Override public void removeRepository( String repoId ) throws RepositoryException { Repository repo = getRepository(repoId); if (repo != null) { removeRepository(repo); } } ArchivaRepositoryRegistry(); @Override void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ); @PreDestroy void destroy(); @Override ArchivaIndexManager getIndexManager( RepositoryType type ); @Override MetadataReader getMetadataReader( final RepositoryType type ); @Override Collection<Repository> getRepositories( ); @Override Collection<ManagedRepository> getManagedRepositories( ); @Override Collection<RemoteRepository> getRemoteRepositories( ); @Override Collection<RepositoryGroup> getRepositoryGroups( ); @Override Repository getRepository( String repoId ); @Override ManagedRepository getManagedRepository( String repoId ); @Override RemoteRepository getRemoteRepository( String repoId ); @Override RepositoryGroup getRepositoryGroup( String groupId ); @Override ManagedRepository putRepository( ManagedRepository managedRepository ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration ); @Override ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroup repositoryGroup ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration ); @Override RepositoryGroup putRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override RemoteRepository putRepository( RemoteRepository remoteRepository ); @Override RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration ); @Override @SuppressWarnings("unchecked") RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration ); @Override void removeRepository( String repoId ); @Override void removeRepository( Repository repo ); @Override void removeRepository( ManagedRepository managedRepository ); @Override void removeRepository( ManagedRepository managedRepository, Configuration configuration ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup ); @Override void removeRepositoryGroup( RepositoryGroup repositoryGroup, Configuration configuration ); @Override void removeRepository( RemoteRepository remoteRepository ); @Override void removeRepository( RemoteRepository remoteRepository, Configuration configuration ); @Override void reload( ); @Override void resetIndexingContext( Repository repository ); @Override ManagedRepository clone( ManagedRepository repo, String newId ); @Override Repository clone( T repo, String newId ); @Override RemoteRepository clone( RemoteRepository repo, String newId ); @Override Repository getRepositoryOfAsset( StorageAsset asset ); @Override void configurationEvent(ConfigurationEvent event); @Override void registerEventHandler( EventType<T> type, EventHandler<? super T> eventHandler); @Override void unregisterEventHandler(EventType<T> type, EventHandler<? super T> eventHandler); @Override void handle(Event event);  }### Answer:
@Test public void removeRepository( ) throws Exception { assertEquals(5, repositoryRegistry.getRepositories().size()); Repository repo = repositoryRegistry.getRepository( "snapshots" ); repositoryRegistry.removeRepository( repo ); assertEquals(4, repositoryRegistry.getRepositories().size()); assertTrue( repositoryRegistry.getRepositories( ).stream( ).noneMatch( rep -> rep.getId( ).equals( "snapshots" ) ) ); archivaConfiguration.reload(); repositoryRegistry.reload(); assertEquals(4, repositoryRegistry.getRepositories().size()); }