### Question:
DefaultEntityView implements EntityView { @Override public <K extends Entity.Key<S>, S extends Specification> Optional<Entity<K, S>> get(K key) { return Optional.ofNullable((Entity<K, S>) entities.get(key)); } DefaultEntityView(EventReceiver receiver, Map<Entity.Key<?>, Entity<?, ?>> entities);  DefaultEntityView(EventReceiver receiver); @Override CompletableFuture<Void> load(@NonNull EntityViewListener listener); @Override CompletableFuture<Void> load(); @Override Optional<Entity<K, S>> get(K key); @Override Stream<Entity<K, S>> all(Class<K> keyClass);  }### Answer:
@Test public void getPresent() { entities.put(key, entity); var result = underTest.get(key); assertThat(result.isPresent(), is(true)); assertThat(result.get(), is(entity)); }
@Test public void getAbsent() { var result = underTest.get(key); assertThat(result.isPresent(), is(false)); }