GroupImpl extends AuthorizableImpl implements Group { @Override public boolean removeMember(@NotNull Authorizable authorizable) throws RepositoryException { if (!isValidAuthorizableImpl(authorizable)) { log.warn("Invalid Authorizable: {}", authorizable); return false; } AuthorizableImpl authorizableImpl = ((AuthorizableImpl) authorizable); if (isEveryone() || authorizableImpl.isEveryone()) { log.debug("Attempt to remove member from everyone group or remove membership for it."); return false; } else { Tree memberTree = authorizableImpl.getTree(); boolean success = getMembershipProvider().removeMember(getTree(), memberTree); if (success) { getUserManager().onGroupUpdate(this, true, authorizable); } return success; } } GroupImpl(String id, Tree tree, UserManagerImpl userManager); @Override boolean isGroup(); @NotNull @Override Principal getPrincipal(); @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 testRemoveMemberInvalidAuthorizable() throws Exception { assertFalse(group.removeMember(Mockito.mock(Authorizable.class))); }
@Test public void testRemoveNotMember() throws Exception { assertFalse(group.removeMember(getTestUser())); }