@Test public void readAll_shouldReturnAllBooks() { setBooksFieldMap(); List<Book> allBooks = bookDao.readAll(); assertEquals(1, allBooks.size()); assertTrue(allBooks.contains(book)); assertNotSame(book, allBooks.get(0)); assertReflectionEquals(book, allBooks.get(0)); clearBooksFieldMap(); allBooks = bookDao.readAll(); assertTrue(allBooks.isEmpty()); }
@Nonnull public List<Book> readAll() { return new ArrayList<Book>(books.values()); }
BookDao { @Nonnull public List<Book> readAll() { return new ArrayList<Book>(books.values()); } }
BookDao { @Nonnull public List<Book> readAll() { return new ArrayList<Book>(books.values()); }  }
BookDao { @Nonnull public List<Book> readAll() { return new ArrayList<Book>(books.values()); }  @Nonnull Optional<Book> create(@Nonnull final Book bookToCreate); @Nonnull List<Book> readAll(); @Nonnull Optional<Book> readByIsbn(@Nonnull final String isbn); @Nonnull Optional<Book> update(@Nonnull final Book bookToUpdate); boolean delete(@Nonnull final Book bookToDelete); }
BookDao { @Nonnull public List<Book> readAll() { return new ArrayList<Book>(books.values()); }  @Nonnull Optional<Book> create(@Nonnull final Book bookToCreate); @Nonnull List<Book> readAll(); @Nonnull Optional<Book> readByIsbn(@Nonnull final String isbn); @Nonnull Optional<Book> update(@Nonnull final Book bookToUpdate); boolean delete(@Nonnull final Book bookToDelete);  }