title: Getting all wall posts and comments using RestFB
body: <p>At first: I know there were some similar topics and I wrote some code according to them (as seeing below). I'm new in Facebook api so I'm a little bit lost :D<br>
  Anyway, my app has to get all wall posts and comments but I'm not able to get it all. Could anyone help me please? Here are my methods:</p>
  
  <pre><code>public static void getFacebookPosts(String url){            
              try{
                    LoggedFacebookClient client = new LoggedFacebookClient();
  
                    Page page = client.fetchObject(url, Page.class);  
                    System.out.println(page.getName());
                    Connection&lt;Post&gt; pageFeed = client.fetchConnection(page.getId() + "/feed", Post.class);
  
              //Getting posts:
                    for (List&lt;Post&gt; feed : pageFeed){
                          for (Post post : feed){     
                               //PRINTING THE POST 
                               getAllPostComments(post.getId(), client);
                          }
                     }
              }catch(com.restfb.exception.FacebookOAuthException ex){
                    System.out.println("\n!!!!!!! Token Expired !!!!!!!!\n");
              }
  }
  
  private static void getAllPostComments(String postId, DefaultFacebookClient client){
              int currentCount = 0;
              JsonObject jsonObject = client.fetchObject(postId + "/comments", JsonObject.class, 
                    Parameter.with("summary", true), Parameter.with("limit", 1));
              long commentsTotalCount = jsonObject.getJsonObject("summary").getLong("total_count");
  
              System.out.println("\nComments:");
              boolean pom = true;
              while(pom == true){       //There should be "while(currentCount &lt; commentsTotalCount)" but currentCount is always &lt; then commentsTotalCount. That's the problem :)
                    pom = false;
                    Connection&lt;Comment&gt; comments = client.fetchConnection(postId + "/comments", 
                          Comment.class, Parameter.with("limit", 50000), Parameter.with("offset", currentCount));
  
                    for(Comment komentar : comments.getData()){
                          pom = true;
                          currentCount++;
                          stazenychKomentu++;
                          String mess = komentar.getMessage().replaceAll("\n", " ").replaceAll("\r", " ");
                          System.out.println("    [" + currentCount + "]: " + komentar.getFrom().getName() + " ## " + mess);
                    }
              }
              celkemKomentu += commentsTotalCount;
              System.out.println(currentCount + " / " + commentsTotalCount);
  }
  </code></pre>
  
  <p>and here is the way I get the acces token:</p>
  
  <pre><code>public LoggedFacebookClient(){
         super();
         AccessToken accessToken = this.obtainAppAccessToken(API_KEY, APP_SECRET);
         this.accessToken = accessToken.getAccessToken();
  }
  </code></pre>
  
  <p>I would be very grateful if anyone could help me. Thanks a lot and sorry if my English isn't perfect.</p>