### Question:
SupervisedItem extends WorkspaceItem { public Group[] getSupervisorGroups(Context c, int wi) throws SQLException { List<Group> groupList = new ArrayList<Group>(); String query = "SELECT epersongroup.* " + "FROM epersongroup, epersongroup2workspaceitem " + "WHERE epersongroup2workspaceitem.workspace_item_id" + " = ? " + " AND epersongroup2workspaceitem.eperson_group_id =" + " epersongroup.eperson_group_id " + "ORDER BY epersongroup.name"; TableRowIterator tri = DatabaseManager.queryTable(c,"epersongroup",query, wi); try { while (tri.hasNext()) { TableRow row = tri.next(); Group group = Group.find(c,row.getIntColumn("eperson_group_id")); groupList.add(group); } } finally { if (tri != null) { tri.close(); } } return groupList.toArray(new Group[groupList.size()]); } SupervisedItem(Context context, TableRow row); static SupervisedItem[] getAll(Context context); Group[] getSupervisorGroups(Context c, int wi); Group[] getSupervisorGroups(); static SupervisedItem[] findbyEPerson(Context context, EPerson ep);  }### Answer:
@Test public void testGetSupervisorGroups_Context_int() throws Exception { Group[] found = si.getSupervisorGroups(context, wi.getID()); assertThat("testGetSupervisorGroups_Context_int 0", found, notNullValue()); assertTrue("testGetSupervisorGroups_Context_int 1", found.length == 1); assertThat("testGetSupervisorGroups_Context_int 2", found[0].getID(), equalTo(gr.getID())); }
@Test public void testGetSupervisorGroups_0args() throws Exception { Group[] found = si.getSupervisorGroups(); assertThat("testGetSupervisorGroups_0args 0", found, notNullValue()); assertTrue("testGetSupervisorGroups_0args 1", found.length == 1); boolean added = false; for(Group g: found) { if(g.equals(gr)) { added = true; } } assertTrue("testGetSupervisorGroups_0args 2",added); }