### Question:
DefaultRepository implements com.expediagroup.streamplatform.streamregistry.repository.Repository<ME, MK> { @Override public Optional<ME> findById(MK key) { return view .get(converter.convertKey(key)) .map(converter::convertEntity); }  @Override ME save(ME entity); @Override Optional<ME> findById(MK key); @Override List<ME> findAll(); @Override List<ME> findAll(ME example);  }### Answer:
@Test public void findById() { when(view.get(SampleState.domainKey())).thenReturn(Optional.of(SampleState.domain())); Optional<Domain> result = underTest.findById(SampleModel.domainKey()); assertThat(result.isPresent(), is(true)); assertThat(result.get(), is(SampleModel.domain())); }