@SuppressWarnings("PMD.ConfusingTernary")
    public final <T> Key<T> createKey(TypeLiteral<T> type) {
        checkNotNull(type, "type is null");

        if (annotation != null) {
            return Key.get(type, annotation);
        } else if (annotationClass != null) {
            return Key.get(type, annotationClass);
        } else {
            throw new IllegalStateException("Neither annotation or annotation class found!");
        }
    }
Creates a {@link Key} object for a {@link TypeLiteral} that uses the annotation or annotation class used to construct this module.
guice/src/main/java/org/jdbi/v3/guice/AbstractJdbiDefinitionModule.java