void () { //com.b<->com.a - find //com.c<->com.d - not in scope final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(getProject(), new JavaAnalysisScope(JavaPsiFacade .getInstance(getProject()).findPackage( "com.subscope1"), null)); builder.analyze(); final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies(); HashMap<String, String[][]> expected = new HashMap<>(); expected.put("com.subscope1.b", new String[][]{{"com.subscope1.a", "com.subscope1.b"}}); expected.put("com.subscope1.a", new String[][]{{"com.subscope1.b", "com.subscope1.a"}}); checkResult(expected, cyclicDependencies); }