Optimize imports

You can delete import statements for all unused packages within a file. Press &shortcut:OptimizeImports; (Code | Optimize Imports) or &shortcut:ShowIntentionActions; (when the caret is at the import statement), and then select Optimize Imports.

Optimize import statements