code: public static Matcher<JsonElement> isOfType(final String type) {
          return new TypeSafeDiagnosingMatcher<JsonElement>() {
              @Override
              protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
                  if (type.equals(item.getJsonType()))
                      return true;
                  else {
                      mismatchDescription.appendText(", mismatch type '" + item.getJsonType() + "'");
                      return false;
                  }
              }
  
              @Override
              public void describeTo(Description description) {
                  description.appendText("\nMatch to type: " + type);
              }
          };
      }
docs: ==> COMMON ==>