class ReferenceLibrary {

  public @Nonnull ReferenceLibrary mergeReferenceBooks(Collection<ReferenceBook> newBooks) {
    List<ReferenceBook> booksToKeep =
        _books.stream()
            .filter(
                originalBook ->
                    !newBooks.stream()
                        .anyMatch(newBook -> newBook.getName().equals(originalBook.getName())))
            .collect(Collectors.toList());

    booksToKeep.addAll(newBooks);
    return new ReferenceLibrary(booksToKeep);
  }

  @JsonCreator public  ReferenceLibrary(@JsonProperty(PROP_BOOKS) @Nullable List<ReferenceBook> books);

}