class ImmutableSearchResultBuilder implements SearchResultBuilder {

    public static SearchResultBuilder of(final SearchResult searchResult) {
        checkNotNull(searchResult, "search result");

        final JsonArrayBuilder jsonArrayBuilder = JsonFactory.newArrayBuilder(searchResult.getItems());
        final Long nextPageOffset = searchResult.getNextPageOffset().orElse(null);
        final String cursor = searchResult.getCursor().orElse(null);

        return new ImmutableSearchResultBuilder(jsonArrayBuilder).nextPageOffset(nextPageOffset).cursor(cursor);
    }

    private  ImmutableSearchResultBuilder(final JsonArrayBuilder theJsonArrayBuilder);

}