void () { myFixture.allowTreeAccessForAllFiles(); myVisibilityInspection.SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS = true; addJavaFile("x/Outer.java", """ package x; public class Outer { <warning descr="Access can be package-private">public</warning> void foo() {} public void fromOtherPackage() {} } """); addJavaFile("x/Consumer.java", """ package x; public class Consumer { public void doIt(Outer o) { o.foo(); o.fromOtherPackage(); } }"""); addJavaFile("y/ConsumerOtherPackage.java", """ package y; public class ConsumerOtherPackage { public void doIt(x.Outer o) { o.fromOtherPackage(); } }"""); myFixture.configureByFiles("x/Outer.java", "x/Consumer.java", "y/ConsumerOtherPackage.java"); myFixture.checkHighlighting(); }