void (@NotNull String text, String @NotNull [] highlighted, String @NotNull [] disabled, int index) { final String[] hintText = myListOfTexts.get(index); final EnumSet<Flag>[] hintFlags = myListOfFlags.get(index); assertEquals("Signature", text, StringUtil.join(hintText, "")); final StringBuilder wrongs = new StringBuilder(); // see if highlighted matches final Set<String> highlightSet = Set.of(highlighted); for (int i = 0; i < hintText.length; i++) { if (hintFlags[i].contains(Flag.HIGHLIGHT) && !highlightSet.contains(hintText[i])) { wrongs.append("Highlighted unexpected '").append(hintText[i]).append("'. "); } } for (int i = 0; i < hintText.length; i++) { if (!hintFlags[i].contains(Flag.HIGHLIGHT) && highlightSet.contains(hintText[i])) { wrongs.append("Not highlighted expected '").append(hintText[i]).append("'. "); } } // see if disabled matches final Set<String> disabledSet = Set.of(disabled); for (int i = 0; i < hintText.length; i++) { if (hintFlags[i].contains(Flag.DISABLE) && !disabledSet.contains(hintText[i])) { wrongs.append("Highlighted a disabled '").append(hintText[i]).append("'. "); } } for (int i = 0; i < hintText.length; i++) { if (!hintFlags[i].contains(Flag.DISABLE) && disabledSet.contains(hintText[i])) { wrongs.append("Not disabled expected '").append(hintText[i]).append("'. "); } } // if (wrongs.length() > 0) fail(wrongs.toString()); }