class ImmutableJsonObjectBuilder implements JsonObjectBuilder {

    @Override
    public ImmutableJsonObjectBuilder setAll(final Iterable<JsonField> fields, final Predicate<JsonField> predicate) {
        requireNonNull(fields, "The JSON fields to be set must not be null!");
        checkPredicate(predicate);

        StreamSupport.stream(fields.spliterator(), false)
                .filter(field -> !field.getDefinition().isPresent() || predicate.test(field))
                .forEach(fieldToBeSet -> this.fields.put(fieldToBeSet.getKeyName(), fieldToBeSet));

        return this;
    }

    private  ImmutableJsonObjectBuilder();

}