@Nullable
  @Override
  public GenericRow decode(byte[] payload, GenericRow destination) {
    try {
      destination = (GenericRow) _decodeMethod.invoke(null, payload, destination);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return destination;
  }
@Test
  public void testComplexClass()
      throws Exception {
    ProtoBufCodeGenMessageDecoder messageDecoder = setupDecoder("complex_types.jar",
        "org.apache.pinot.plugin.inputformat.protobuf.ComplexTypes$TestMessage", getSourceFieldsForComplexType());
    Map<String, Object> inputRecord = createComplexTypeRecord();
    GenericRow destination = new GenericRow();
    messageDecoder.decode(getComplexTypeObject(inputRecord).toByteArray(), destination);

    ComplexTypes.TestMessage msg = getComplexTypeObject(inputRecord);
    msg.getComplexMapMap().forEach((k, v) -> {
      v.getAllFields().forEach((fieldDescriptor, value) -> {
        assertEquals(
            ((Map<String, Object>) ((Map<String, Object>) destination.getValue("complex_map"))
                .get(k)).get(fieldDescriptor.getName()),
            value);
      });
    });
    for (String col : getSourceFieldsForComplexType()) {
      assertNotNull(destination.getValue(col));
    }

    for (String col : getSourceFieldsForComplexType()) {
      if (col.contains("field")) {
        assertEquals(destination.getValue(col), inputRecord.get(col));
      }
    }
  }