### Question:
PermissionRow { public PermissionRow addGroup(@Nonnull Group group) { groups.add(group); return this; } protected  PermissionRow(String rowLabel, List<Group> groups); List<Group> getGroups(); String getRowLabel(); PermissionRow addGroup(@Nonnull Group group); static PermissionRow newAllowRow(); static PermissionRow newRestrictRow(); static PermissionRow newAllowRow(@Nonnull List<Group> groups); static PermissionRow newRestrictRow(@Nonnull List<Group> groups); static PermissionRow newAllowRow(@Nonnull String rowLabel, @Nonnull List<Group> groups); static PermissionRow newRestrictRow(@Nonnull String rowLabel, @Nonnull List<Group> groups); static final String ALLOW_DEFAULT_LABEL; static final String RESTRICT_DEFAULT_LABEL; }### Answer:
@Test public void addGroupTest() { Group newGroup = new Group("new group for add"); PermissionRow row2 = row.addGroup(newGroup); assertEquals(row, row2); assertEquals(row.getGroups().size(), 3); assertEquals(row.getGroups().get(2), newGroup); }