Accepted answer

Did you have a look at Preferences > Java > Editor > Content Assist > Favorites? You can define candidates for static imports there. Result:

enter image description here

For less used classes you can lower the value of Preferences > Java > Code Style > Organize Imports > Number of static imports needed for .* but beware that you may get .* for classes that contain generically named methods such as getInstance. This in turn may lead to confusion and/or naming conflicts.


You can add the classes that you statically import from Preferences > Java > Editor > Content Assist > Favorites page in Eclipse. Then, Ctrl+Space shortcut lists all the static members of your favourite classes in the content assist menu.


You can use Ctrl + Shift + M, for example you want to import verify method from Mockito class then

Mockito.verify() // select verify and press Ctrl + Shift + M

This will import verify static method from Mockito class.

Related Query

More Query from same tag