title: Page<T> Object throws NPE in foreach loop
body: <p>I have a test where a repository call returns a <code>Page&lt;Entity&gt;</code> object.</p>
  
  <p>After this I'm iterating throught the elements in a foreach loop</p>
  
  <pre><code>    for (Entity entity : pageableObject) {
       //SOME CODE
      }
  </code></pre>
  
  <p>I'm always getting a <code>NullPointerException</code> at the forEach line.</p>
  
  <p>I tried several things:</p>
  
  <ol>
  <li>Create a dummy <code>PageImpl</code> with no elements  </li>
  <li>Mock the Pageable result.</li>
  </ol>
  
  <p>Still I am getting an NPE. When I reach the forEach  loop, the pageableObject exists (as a real object, or as a mock depending on the solution 1 or 2)</p>
  
  <p>What could be the problem here?</p>