ImmutableJsonFieldSelectorBuilder implements JsonFieldSelectorBuilder { @Override public JsonFieldSelectorBuilder addFieldSelector(final JsonFieldSelector fieldSelector) { return addPointers(requireNonNull(fieldSelector, "The JSON field selector must not be null!")); } private  ImmutableJsonFieldSelectorBuilder(); static ImmutableJsonFieldSelectorBuilder newInstance(); @Override JsonFieldSelectorBuilder addPointerString(final String pointerString,
            final String... furtherPointerStrings); @Override JsonFieldSelectorBuilder addPointerStrings(final Iterable<String> pointerStrings); @Override JsonFieldSelectorBuilder addPointer(@Nullable final JsonPointer pointer,
            final JsonPointer... furtherPointers); @Override JsonFieldSelectorBuilder addPointers(final Iterable<JsonPointer> pointers); @Override JsonFieldSelectorBuilder addFieldDefinition(@Nullable final JsonFieldDefinition fieldDefinition,
            final JsonFieldDefinition... furtherFieldDefinitions); @Override JsonFieldSelectorBuilder addFieldDefinitions(final Iterable<JsonFieldDefinition> fieldDefinitions); @Override JsonFieldSelectorBuilder addFieldSelector(final JsonFieldSelector fieldSelector); @Override JsonFieldSelectorBuilder addFieldSelectorString(@Nullable final String fieldSelectorString,
            final JsonParseOptions options); @Override JsonFieldSelectorBuilder addFieldSelectorString(@Nullable final String fieldSelectorString); @Override JsonFieldSelectorBuilder removePointer(@Nullable final JsonPointer jsonPointer); @Override JsonFieldSelectorBuilder removePointers(final Iterable<JsonPointer> jsonPointers); @Override JsonFieldSelectorBuilder removePointerString(@Nullable final String pointerString); @Override JsonFieldSelectorBuilder removePointerStrings(final Iterable<String> pointerStrings); @Override JsonFieldSelectorBuilder removeFieldDefinition(@Nullable final JsonFieldDefinition fieldDefinition); @Override JsonFieldSelectorBuilder removeFieldDefinitions(final Iterable<JsonFieldDefinition> fieldDefinitions); @Override Iterator<JsonPointer> iterator(); @Override JsonFieldSelector build(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void addNullFieldSelector() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> underTest.addFieldSelector(null)) .withMessage("The %s must not be null!", "JSON field selector") .withNoCause(); }
@Test public void addFieldSelector() { final String pointerCString = "/c"; final JsonPointer pointerC = JsonFactory.newPointer(pointerCString); underTest.addPointerString(pointerCString); underTest.addFieldSelector(ImmutableJsonFieldSelector.of(Arrays.asList(pointerA, pointerB))); final JsonFieldSelector actual = underTest.build(); assertThat(actual).containsExactly(pointerC, pointerA, pointerB); }