GroupImpl extends AuthorizableImpl implements Group { @NotNull @Override public Set<String> addMembers(@NotNull String... memberIds) throws RepositoryException { try { return getDelegate().addMembers(memberIds); } finally { getMgr().autosave(); } } GroupImpl(Group dlg, AutoSaveEnabledManager mgr); @NotNull @Override Iterator<Authorizable> getDeclaredMembers(); @NotNull @Override Iterator<Authorizable> getMembers(); @Override boolean isDeclaredMember(@NotNull Authorizable authorizable); @Override boolean isMember(@NotNull Authorizable authorizable); @Override boolean addMember(@NotNull Authorizable authorizable); @NotNull @Override Set<String> addMembers(@NotNull String... memberIds); @Override boolean removeMember(@NotNull Authorizable authorizable); @NotNull @Override Set<String> removeMembers(@NotNull String... memberIds);  }
@Test public void testAddMembersById() throws Exception { assertEquals(ImmutableSet.of("m1", "m2", "m3"), group.addMembers("m1", "m2", "m3")); verify(dlg, times(1)).addMembers("m1", "m2", "m3"); verify(autosaveMgr, times(1)).autosave(); }