@Override
    public boolean hasNext() {
        if (resource != null) {
            return true;
        }
        resource = nextResource();
        return (resource != null);
    }
Used to iterate through a list of resources already retrieved.
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/internal/IteratorSupport.java