Pattern: Top-level class not in separate source file
Issue: -
Each top-level class should reside in a source file of its own to avoid any confusion or misunderstanding. If file doesn't contain public class, enum or interface, top-level type is the first type in file.
<module name="OneTopLevelClass"/>
An example of code with violations:
public class Foo{
//methods
}
class Foo2{
//methods
}
An example of code without violations:
public class Foo{
//methods
}