private static Method findGetter(MethodTuple setter, Object object) {
        Matcher m = Pattern.compile("\\A(?:get|is)([A-Z].+)\\Z").matcher("");
        for (Method method : object.getClass().getMethods()) {
            if (object.getClass().getName().contains("PDF")) {
                System.out.println(method.getName());
            }
            if (m.reset(method.getName()).find()) {
                if (object.getClass().getName().contains("PDF")) {
                    System.out.println("2: " + method.getName());
                }
                String paramName = m.group(1);
                if (setter.name.equals(paramName)) {
                    Class returnType = method.getReturnType();
                    if (setter.singleParam.equals(returnType)) {
                        return method;
                    }
                }
            }
        }
        return null;
    }
@param config  config to serialize
@param mode    serialization mode
@param writer  writer
@param charset charset
@throws Exception
tika-core/src/main/java/org/apache/tika/config/TikaConfigSerializer.java