void (HashMap<String, String[][]> expected, HashMap<PsiPackage, Set<List<PsiPackage>>> cycles) { assertEquals(expected.size(), cycles.size()); Iterator<PsiPackage> it = cycles.keySet().iterator(); for (final String packs : expected.keySet()) { final PsiPackage psiPackage = it.next(); assertEquals(packs, psiPackage.getQualifiedName()); assertEquals(expected.get(packs).length, cycles.get(psiPackage).size()); Iterator<List<PsiPackage>> iC = cycles.get(psiPackage).iterator(); for (int i = 0; i < expected.get(packs).length; i++) { final String[] expectedCycle = expected.get(packs)[i]; final List<PsiPackage> cycle = iC.next(); assertEquals(expectedCycle.length, cycle.size()); Iterator<PsiPackage> iCycle = cycle.iterator(); for (final String expectedInCycle : expectedCycle) { final PsiPackage packageInCycle = iCycle.next(); assertEquals(expectedInCycle, packageInCycle.getQualifiedName()); } } } }