// good catch!
}
}
private void checkAddCategory(Class cls, String category, String[] expected) {
FetchGroup fg = pm.getFetchGroup(cls, "test" + count() + category);
Set expectedSet = new HashSet();
expectedSet.addAll(Arrays.asList(expected));
Set members = fg.getMembers();
assertTrue("New FetchGroup should have no members; "
+ printFetchGroup(fg),
members.isEmpty());
fg.addCategory(category);
members = fg.getMembers();
if (!members.equals(expectedSet)) {
appendMessage("FetchGroup(" + cls.getName()
+ ".addCategory(" + category + ") should contain\n"
+ expectedSet + " but contains\n" + members);
}