ImmutableSearchResultBuilder implements SearchResultBuilder { @Override public SearchResult build() { final JsonArray searchResultsJsonArray = jsonArrayBuilder.build(); return ImmutableSearchResult.of(searchResultsJsonArray, offset, cursor); } private  ImmutableSearchResultBuilder(final JsonArrayBuilder theJsonArrayBuilder); static SearchResultBuilder newInstance(); static SearchResultBuilder of(final SearchResult searchResult); @Override SearchResultBuilder nextPageOffset(@Nullable final Long nextPageOffset); @Override SearchResultBuilder cursor(@Nullable final String cursor); @Override SearchResultBuilder add(final JsonValue value, final JsonValue... furtherValues); @Override SearchResultBuilder addAll(final Iterable<? extends JsonValue> values); @Override SearchResultBuilder remove(final JsonValue value); @Override SearchResult build();  }
@Test public void createEmptySearchResult() { final SearchResult searchResult = underTest.build(); assertThat(searchResult) .hasNoNextPage() .isEmpty(); }