I have a Java project in IntelliJ to which I just added a bunch of files in a nested folder hierarchy. Many of these files are tests and include the main method, so I should be
Select the folder containing the package tree of these classes, right-click and choose "Mark Directory as -> Source Root"