class LocalDhisResourceRepositoryContainerImpl implements LocalDhisResourceRepositoryContainer {

    @Nonnull
    @Override
    @SuppressWarnings( "unchecked" )
    public <T extends DhisResource> LocalDhisResourceRepository<T> getRepository(
        @Nonnull Class<T> resourceClass, @Nonnull LocalDhisRepositoryPersistCallback<T> persistCallback )
    {
        if ( !supportedResourceClasses.contains( resourceClass ) )
        {
            throw new IllegalArgumentException( "Resource class is not supported: " + resourceClass );
        }

        final RepositoryItem<? extends DhisResource> repositoryItem = repositoryItems.computeIfAbsent( resourceClass,
            rc -> new RepositoryItem<>( new LocalDhisResourceRepositoryImpl<>( resourceClass ), persistCallback ) );

        return (LocalDhisResourceRepository<T>) repositoryItem.getResourceRepository();
    }

    public  LocalDhisResourceRepositoryContainerImpl( @Nonnull Set<Class<? extends DhisResource>> supportedResourceClasses );

}