void (HashMap<String, String[][]> expected, HashMap<PsiPackage, Set<List<PsiPackage>>> cycles, boolean forceContains) { assertEquals(expected.size(), cycles.size()); for (final PsiPackage psiPackage : cycles.keySet()) { assertTrue(expected.containsKey(psiPackage.getQualifiedName())); final String packs = psiPackage.getQualifiedName(); if (forceContains) { assertEquals(expected.get(packs).length, cycles.get(psiPackage).size()); } for (final List<PsiPackage> cycle : cycles.get(psiPackage)) { final String[][] expectedCycles = expected.get(packs); final String[] string = new String[cycle.size()]; int i = 0; for (final PsiPackage packageInCycle : cycle) { string[i++] = packageInCycle.getQualifiedName(); } assertTrue(findInMatrix(expectedCycles, string) > -1); } } }