private static void removeTypeFromJson(JsonElement json) {
    if (json.isJsonArray()) {
      for (JsonElement child : json.getAsJsonArray()) {
        removeTypeFromJson(child);
      }
    } else if (json.isJsonObject()) {
      Iterator<Entry<String, JsonElement>> iterator = json.getAsJsonObject().entrySet().iterator();

      while (iterator.hasNext()) {
        Entry<String, JsonElement> entry = iterator.next();
        if (TYPE_KEY.equals(entry.getKey())) {
          iterator.remove();
        } else {
          removeTypeFromJson(entry.getValue());
        }
      }
    }
  }
This class converts PB Messages to various representations, like:
<ul>
<li>JSON string: {@link #toJsonElement(MessageOrBuilder)}</li>
<li>JSON object (gson): {@link #toJsonElement(MessageOrBuilder)}</li>
<li>Java objects (Boolean, Number, String, List, Map): {@link #toJavaObject(JsonElement)}</li>
</ul>
hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMessageConverter.java