JsonBodyFilters { @API(status = EXPERIMENTAL) public static BodyFilter replacePrimitiveJsonProperty( final Predicate<String> predicate, final String replacement) { return replacePrimitive(predicate, replacement); } private  JsonBodyFilters(); @API(status = MAINTAINED) static BodyFilter accessToken(); @API(status = MAINTAINED) static BodyFilter replaceJsonStringProperty(
            final Set<String> properties, final String replacement); @API(status = EXPERIMENTAL) static BodyFilter replaceJsonStringProperty(
            final Predicate<String> predicate, final String replacement); @API(status = EXPERIMENTAL) static BodyFilter replaceJsonNumberProperty(
            final Set<String> properties, final Number replacement); @API(status = EXPERIMENTAL) static BodyFilter replaceJsonNumberProperty(
            final Predicate<String> predicate, final Number replacement); @API(status = EXPERIMENTAL) static BodyFilter replacePrimitiveJsonProperty(
            final Predicate<String> predicate, final String replacement);  }
@Test void shouldFilterPrimitives() { final BodyFilter unit = replacePrimitiveJsonProperty( asList("foo", "bar", "baz")::contains, "XXX"); final String actual = unit.filter( contentType, "{\"foo\":1.0,\"bar\":false,\"baz\":\"secret\"}"); assertThat(actual, is("{\"foo\":\"XXX\",\"bar\":\"XXX\",\"baz\":\"XXX\"}")); }