*/
public static void main(String[] args) {
GetAllCommunitiesApp app = new GetAllCommunitiesApp();
try {
CommunityService communityService = app.getCommunityService();
Collection<Community> communities = communityService.getPublicCommunities();
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("ps", "100"); //100 members will be retrieved at a time. Max is 10,000.
for (Iterator<Community> iter = communities.iterator(); iter.hasNext(); ) {
Community community = iter.next();
boolean moreMembers = true;
int page = 1;
System.out.println(community.getTitle());
do{
parameters.put("page", Integer.toString(page));
EntityList<Member> members = communityService.getMembers(community.getCommunityUuid(), parameters);
for (int i=0; i<members.size(); i++) {
System.out.println(" " + members.get(i).getEmail());
}
if((members.getStartIndex() + members.getItemsPerPage()) <= members.getTotalResults()){
moreMembers = true;