code: public static Matcher<JsonElement> isElementValid(final Validator validator, final JsonElement element) {
          return new TypeSafeDiagnosingMatcher<JsonElement>() {
              @Override
              protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
                  if (!validator.isValid(element)) {
                      mismatchDescription.appendText("element: " + element.toString() + ", does not validate by validator " + validator.getTitle());
                      return false;
                  }
                  return true;
              }
  
              @Override
              public void describeTo(Description description) {
                  description.appendText("is array item valid");
              }
          };
      }
docs: General matcher
  
  @param validator
  @param element
  @return