IntelliJ IDEA keyboard shortcut
Press Ctrl + − to collapse code block.
Practice this shortcut All IntelliJ IDEA shortcuts