code: public <M extends Message> M deserialize(String jsonStringRep, Class<M> messageClass) throws CouldNotPerformException {
          try {
              try {
                  Message.Builder builder = (Message.Builder) messageClass.getMethod("newBuilder").invoke(null);
                  jsonFormat.merge(new ByteArrayInputStream(jsonStringRep.getBytes(Charset.forName(UTF8))), builder);
                  return (M) builder.build();
              } catch (IOException ex) {
                  throw new CouldNotPerformException("Could not merge [" + jsonStringRep + "] into builder", ex);
              } catch (NoSuchMethodException | SecurityException ex) {
                  throw new CouldNotPerformException("Could not find or access newBuilder method of type [" + messageClass + "]", ex);
              } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
                  throw new CouldNotPerformException("Could not invoke newBuilder method of type [" + messageClass + "]", ex);
              }
          } catch (CouldNotPerformException | NullPointerException ex) {
              throw new CouldNotPerformException("Could not deserialize json String[" + jsonStringRep + "] into protobuf type of Class[" + messageClass + "]!", ex);
          }
      }
docs: Deserialise a JSon string representation for a protobuf message given the class of the type.
  
  @param jsonStringRep the string representation of the rst value
  @param messageClass  the message class of the type.
  
  @return the deserialized message.
  
  @throws org.openbase.jul.exception.CouldNotPerformException is thrown in case the deserialization fails.