code: private void compactImports() {
          Iterator<TypeName> i = imports.iterator();
          while (i.hasNext()) {
              TypeName importName = i.next();
              if (!importName.getSimpleName().equals("*") && registeredPackages.contains(importName.getPackageName())) {
                  i.remove();
              }
          }
      }
docs: /*
  Removes explicit imports covered by wildcards.