presto-main/src/main/java/io/prestosql/operator/ParametricImplementationsGroup.java/Builder/determineGenericSignature
class Builder:        private static <T extends ParametricImplementation> Signature determineGenericSignature(
                Map<Signature, T> exactImplementations,
                List<T> specializedImplementations,
                List<T> genericImplementations)
        {
            if (specializedImplementations.size() + genericImplementations.size() == 0) {
                return getOnlyElement(exactImplementations.keySet());
            }

            Optional<Signature> signature = Optional.empty();
            for (T implementation : specializedImplementations) {
                validateSignaturesCompatibility(signature, implementation.getSignature());
                signature = Optional.of(implementation.getSignature());
            }

            for (T implementation : genericImplementations) {
                validateSignaturesCompatibility(signature, implementation.getSignature());
                signature = Optional.of(implementation.getSignature());
            }

            return signature.get();
        }