DefaultKeyValueRepositoryProducer implements KeyValueRepositoryProducer { @Override public <E, ID, T extends Repository<E, ID>> T get(Class<T> repositoryClass, BucketManager manager) { Objects.requireNonNull(repositoryClass, "repository class is required"); Objects.requireNonNull(manager, "manager class is required"); KeyValueTemplate template = producer.get(manager); return get(repositoryClass, template); }  @Override T get(Class<T> repositoryClass, BucketManager manager); @Override T get(Class<T> repositoryClass, KeyValueTemplate template);  }
@Test public void shouldCreateFromManager() { BucketManager manager= Mockito.mock(BucketManager.class); PersonRepository personRepository = producer.get(PersonRepository.class, manager); assertNotNull(personRepository); }
@Test public void shouldCreateFromTemplate() { KeyValueTemplate template= Mockito.mock(KeyValueTemplate.class); PersonRepository personRepository = producer.get(PersonRepository.class, template); assertNotNull(personRepository); }