@Override
@SuppressWarnings("unchecked")
public Import addImport(final String className)
{
String strippedClassName = Types.stripGenerics(Types.stripArray(className));
Import imprt;
if (Types.isSimpleName(strippedClassName) && !hasImport(strippedClassName))
{
throw new IllegalArgumentException("Cannot import class without a package [" + strippedClassName + "]");
}
if (!hasImport(strippedClassName) && validImport(strippedClassName))
{
imprt = new ImportImpl(this).setName(strippedClassName);
unit.imports().add(imprt.getInternal());
}
else if (hasImport(strippedClassName))
{
imprt = getImport(strippedClassName);
}