private void addType(Type type, Map<String, Type> types) {
        requireNonNull(type);
        requireNonNull(types);
        
		String name = type.getTypeName();
        
        // Strip any generic parts from the type name
        if (name.contains("<")) {
            name = name.substring(0, name.indexOf('<'));
        }
        
        // Strip any array parts from the type name
        if (name.contains("[")) {
            name = name.substring(0, name.indexOf('['));
        }

        // If the class is not a primitive type and it should be ignored, add
        // it to the ignore list.
		if (name.contains(".") && !mgr.isIgnored(name)) {
            final String shortName = Formatting.shortName(name);

            // If a import already exists with the same suffix, ignore it.
            if (types.keySet().stream()
                .map(Formatting::shortName)
                .noneMatch(shortName::equals)) {

                types.put(name, type);
            }

        }
        
        // Recurse over any type parameters this type might have.
        if (type instanceof ParameterizedType) {
            final ParameterizedType generic = (ParameterizedType) type;
            if (generic.getActualTypeArguments().length > 0) {
                findTypesIn(type, types);
                
                for (final Type genType : generic.getActualTypeArguments()) {
                    addType(genType, types);
                }
            }
        }
	}
Add the specified {@link Type} to the supplied map. The key will be 
calculated using the type name. If the {@code Type} represents a
dependency that should be ignored according to the 
{@link DependencyManager}, it will not be added.

@param type   the type to try to add
@param types  the map to add it to
common-parent/codegen/src/main/java/com/speedment/common/codegen/controller/AutoImports.java