Memento { public Optional<T> getTopItem() { return topItem; } Memento( Set<T> items, Optional<T> topItem ); @SuppressWarnings( "unchecked" ) static Memento<T> empty(); Set<T> getItems(); Optional<T> getTopItem();  }
@Test public void getTopItem() { Optional<FakeItem> actual = memento.getTopItem(); assertThat( actual ).contains( FIRST_ITEM ); }