KeyCloakUserManager extends BaseKeyCloakManager implements UserManager,
                                                                        ContextualManager { @Override public List<User> getAll() throws SecurityManagementException { final List<User> users = new ArrayList<>(); consumeRealm(realmResource -> { final UsersResource usersResource = realmResource.users(); final List<UserRepresentation> userRepresentations = usersResource.list(); if (userRepresentations != null && !userRepresentations.isEmpty()) { for (UserRepresentation userRepresentation : userRepresentations) { final User user = createUser(userRepresentation); users.add(user); } } }); return users; } KeyCloakUserManager(); @Override void initialize(final UserSystemManager userSystemManager); @Override SearchResponse<User> search(SearchRequest request); @Override User get(String username); @Override List<User> getAll(); @Override User create(User entity); @Override User update(User entity); @Override void delete(String... identifiers); @Override UserManagerSettings getSettings(); @Override void assignGroups(String username,
                             Collection<String> groups); @Override void assignRoles(String username,
                            Collection<String> roles); @Override void changePassword(String username,
                               String newPassword); @Override void destroy();  }
@Test public void testGetAllUsers(){ List<User> users = usersManager.getAll(); Assert.assertEquals(usersCount,users.size()); }