ImmutableJsonFieldSelectorFactory { public static ImmutableJsonFieldSelectorFactory newInstance(final String jsonFieldSelectorString, final JsonParseOptions jsonParseOptions) { requireNonNull(jsonFieldSelectorString, "The JSON field selector string must not be null!"); requireNonNull(jsonParseOptions, "The JSON parse options must not be null!"); final String decodedJsonFieldSelectorString = tryToDecodeString(jsonFieldSelectorString, jsonParseOptions); return new ImmutableJsonFieldSelectorFactory(decodedJsonFieldSelectorString); } private  ImmutableJsonFieldSelectorFactory(final String theJsonFieldSelectorString); static ImmutableJsonFieldSelectorFactory newInstance(final String jsonFieldSelectorString,
            final JsonParseOptions jsonParseOptions); JsonFieldSelector newJsonFieldSelector();  }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullString() { ImmutableJsonFieldSelectorFactory.newInstance(null, JSON_PARSE_OPTIONS_WITHOUT_URL_DECODING); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullOptions() { ImmutableJsonFieldSelectorFactory.newInstance("foo", null); }
@Test(expected = JsonFieldSelectorInvalidException.class) public void tryToCreateInstanceWithEmptyString() { ImmutableJsonFieldSelectorFactory.newInstance("", JSON_PARSE_OPTIONS_WITHOUT_URL_DECODING); }
@Test(expected = JsonFieldSelectorInvalidException.class) public void tryToCreateInstanceWithStringContainingUnevenCountOfOpeningAndClosingParentheses() { final String jsonFieldSelectorString = "thingId,attributes(someAttr/subsel,owner"; ImmutableJsonFieldSelectorFactory.newInstance(jsonFieldSelectorString, JSON_PARSE_OPTIONS_WITHOUT_URL_DECODING); }