private Set<Class<?>> init(@Nullable Object implementation, Iterable<Class<?>> candidateInterfaces) {

        // Build the map of method names and their corresponding process functions.
        // If a method is defined multiple times, we take the first definition
        final Set<Class<?>> interfaces = new HashSet<>();

        for (Class<?> iface : candidateInterfaces) {

            final Map<String, AsyncProcessFunction<?, ?, ?>> asyncProcessMap;
            asyncProcessMap = getThriftAsyncProcessMap(implementation, iface);
            if (asyncProcessMap != null) {
                final Map<String, String> camelNameMap = getCamelNameMap(asyncProcessMap.keySet(),
                                                                         iface.getMethods());
                asyncProcessMap.forEach(
                        (name, func) -> registerFunction(iface, name, camelNameMap.get(name),
                                                         func, implementation));
                interfaces.add(iface);
            }

            final Map<String, ProcessFunction<?, ?>> processMap;
            processMap = getThriftProcessMap(implementation, iface);
            if (processMap != null) {
                final Map<String, String> camelNameMap = getCamelNameMap(processMap.keySet(),
                                                                         iface.getMethods());
                processMap.forEach(
                        (name, func) -> registerFunction(iface, name, camelNameMap.get(name), func,
                                                         implementation));
                interfaces.add(iface);
            }
        }

        if (functions.isEmpty()) {
            if (implementation != null) {
                throw new IllegalArgumentException('\'' + implementation.getClass().getName() +
                                                   "' is not a Thrift service implementation.");
            } else {
                throw new IllegalArgumentException("not a Thrift service interface: " + candidateInterfaces);
            }
        }

        return Collections.unmodifiableSet(interfaces);
    }
Creates a new instance from a single Thrift service interface.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/common/thrift/ThriftServiceMetadata.java