void () { //com.b<->com.d //com.b->com.a->com.c->com.b final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(getProject(), new AnalysisScope(getProject())); builder.analyze(); final HashMap<PsiPackage, Set<List<PsiPackage>>> cyclicDependencies = builder.getCyclicDependencies(); HashMap<String, String[][]> expected = new HashMap<>(); expected.put("com.b", new String[][]{{"com.d", "com.b"}, {"com.c", "com.a", "com.b"}}); expected.put("com.d", new String[][]{{"com.b", "com.d"}}); expected.put("com.c", new String[][]{{"com.a", "com.b", "com.c"}}); expected.put("com.a", new String[][]{{"com.b", "com.c", "com.a"}}); checkResult(expected, cyclicDependencies, true); }