docs: private static String serializeProtocol(ProtocolHeader header, Protocol protocol) throws JsonGenerationException, JsonMappingException, IOException{
          ProtocolPair p = new ProtocolPair();
          p.setProtocolHeader(header);
          if(protocol == null){
              p.setType(null);
          } else {
              p.setType(protocol.getClass());
          }
          p.setProtocol(toJsonStr(protocol));
          return toJsonStr(p);
      }