@Test public void testInheritedMembers() throws Exception { GroupPredicate gp = new GroupPredicate(userManager, testGroup.getID(), false); assertTrue(gp.apply(testMember)); assertTrue(gp.apply(testUser)); assertFalse(gp.apply(testGroup)); assertFalse(gp.apply(null)); }
@Override public boolean apply(@Nullable Authorizable authorizable) { String id = getID(authorizable); if (id != null) { if (memberIds.contains(id)) { return true; } else { while (membersIterator.hasNext()) { String memberId = getID(membersIterator.next()); if (memberId != null) { memberIds.add(memberId); if (memberId.equals(id)) { return true; } } } } } return false; }
GroupPredicate implements Predicate<Authorizable> { @Override public boolean apply(@Nullable Authorizable authorizable) { String id = getID(authorizable); if (id != null) { if (memberIds.contains(id)) { return true; } else { while (membersIterator.hasNext()) { String memberId = getID(membersIterator.next()); if (memberId != null) { memberIds.add(memberId); if (memberId.equals(id)) { return true; } } } } } return false; } }
GroupPredicate implements Predicate<Authorizable> { @Override public boolean apply(@Nullable Authorizable authorizable) { String id = getID(authorizable); if (id != null) { if (memberIds.contains(id)) { return true; } else { while (membersIterator.hasNext()) { String memberId = getID(membersIterator.next()); if (memberId != null) { memberIds.add(memberId); if (memberId.equals(id)) { return true; } } } } } return false; } GroupPredicate(@NotNull UserManager userManager, @NotNull String groupId, boolean declaredMembersOnly); }
GroupPredicate implements Predicate<Authorizable> { @Override public boolean apply(@Nullable Authorizable authorizable) { String id = getID(authorizable); if (id != null) { if (memberIds.contains(id)) { return true; } else { while (membersIterator.hasNext()) { String memberId = getID(membersIterator.next()); if (memberId != null) { memberIds.add(memberId); if (memberId.equals(id)) { return true; } } } } } return false; } GroupPredicate(@NotNull UserManager userManager, @NotNull String groupId, boolean declaredMembersOnly); @Override boolean apply(@Nullable Authorizable authorizable); }
GroupPredicate implements Predicate<Authorizable> { @Override public boolean apply(@Nullable Authorizable authorizable) { String id = getID(authorizable); if (id != null) { if (memberIds.contains(id)) { return true; } else { while (membersIterator.hasNext()) { String memberId = getID(membersIterator.next()); if (memberId != null) { memberIds.add(memberId); if (memberId.equals(id)) { return true; } } } } } return false; } GroupPredicate(@NotNull UserManager userManager, @NotNull String groupId, boolean declaredMembersOnly); @Override boolean apply(@Nullable Authorizable authorizable);  }