### Question:
ManagedEntityConfigRepository implements ConfigRepository<T> { public Optional<T> get(String entityId) { return localConfigRepository.getData(entityId) .map(this::overrideWithRemote); } @Inject  ManagedEntityConfigRepository(LocalConfigRepository<T> localConfigRepository, S3ConfigSource s3ConfigSource); Collection<T> getAll(); boolean has(String entityId); Optional<T> get(String entityId); Stream<T> stream();  }### Answer:
@Test public void getReturnsOptionalEmptyIfNoLocalConfigFound() { ManagedEntityConfigRepository<TransactionConfig> configRepo = new ManagedEntityConfigRepository<>(localConfigRepository, s3ConfigSource); Optional<TransactionConfig> result = configRepo.get(BAD_ENTITY_ID); assertThat(result).isNotPresent(); }
@Test public void getReturnsOptionalEmptyIfNoLocalConfigFoundButRemoteExists() { ManagedEntityConfigRepository<TransactionConfig> configRepo = new ManagedEntityConfigRepository<>(localConfigRepository, s3ConfigSource); Optional<TransactionConfig> result = configRepo.get(REMOTE_ONLY_ENTITY_ID); assertThat(result).isNotPresent(); }