dotCMS/dotCMS — pull request #865 by jgambarios (2012-07-27 15:17:28+00:00)
Title: #858

Actually locally I could never reproduce the issue, I'm aware of it but was impossible to me to make it fail..., this is the old code:

```java
@Test
public void findAllCurrentOffsetLimit () throws DotDataException, DotSecurityException {

//Getting all contentlets live/working contentlets
List contentlets = contentletFactory.findAllCurrent( 0, 5 );

//Validations
assertTrue( contentlets != null && !contentlets.isEmpty() );
assertEquals( contentlets.size(), 5 );

//Validate the integrity of the array
Contentlet contentlet = contentletFactory.find( contentlets.iterator().next().getInode() );

//Validations
assertTrue( contentlet != null && ( contentlet.getInode() != null && !contentlet.getInode().isEmpty() ) );
}
```

Its getting a null pointer exception on this line:

```java
//Validate the integrity of the array
Contentlet contentlet = contentletFactory.find( contentlets.iterator().next().getInode() );
```

Where the contentlets array must have data as it passed already two asserts and the contentletFactory object was already used to retrieve the collection.