If you process a list provided by your DAO using a Stream, you'll be surprised!
List<Integer> list = new IndirectList();
list.add(1);
list.stream()
.anyMatch(o -> o.equals(1)); // false
IndirectList
is an implementation provided by EclipseLink that may be returned by your data access layer.
Version of eclipse link:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.0</version>
</dependency>
Other reference: https://stackoverflow.com/questions/35362581/stream-api-not-working-for-lazy-loaded-collections-in-eclipselink-glassfish