Often you will have classes in code and you may want to introduce the interfaces for them. You can automatically extract interfaces from existing classes in IntelliJ IDEA.
Point your cursor on the class you want to extract interface from. Choose the "Ctrl + T" option and invoke the "Refactor This" option. And select "Extract Interface" menu option. From there, in the resulting window, give the name of the interface and the methods from the classes you want to extract into the interface.