void (int finalCount, String... values) { if (myItems == null) { assertEquals(finalCount, 0); return; } int index = 0; for (final LookupElement myItem : myItems) { for (String value : values) { if (value == null) { fail("Unacceptable value reached: " + myItem.getLookupString()); } if (value.equals(myItem.getLookupString())) { index++; break; } } } assertEquals(finalCount, index); }