private boolean isProtobufGeneratedMessage(TypeElement type) {
        List<? extends TypeMirror> interfaces = type.getInterfaces();

        if (interfaces != null) {
            for (TypeMirror implementedInterface : interfaces) {
                if (implementedInterface.toString().startsWith(PROTOBUF_MESSAGE_OR_BUILDER)) {
                    return true;
                } else if (implementedInterface instanceof DeclaredType) {
                    DeclaredType declared = (DeclaredType) implementedInterface;
                    Element supertypeElement = declared.asElement();
                    if (isProtobufGeneratedMessage((TypeElement) supertypeElement)) {
                        return true;
                    }
                }
            }
        }

        TypeMirror superType = type.getSuperclass();
        if (superType instanceof DeclaredType) {
            DeclaredType declared = (DeclaredType) superType;
            Element supertypeElement = declared.asElement();
            return isProtobufGeneratedMessage((TypeElement) supertypeElement);
        }
        return false;
    }
refer <a href="https://github.com/entur/mapstruct-spi-protobuf">mapstruct-spi-protobuf</a>
@author Arne Seime
commons-mapstruct-spi/src/main/java/com/navercorp/pinpoint/mapstruct/spi/ProtobufAccessorNamingStrategy.java