Fix Null Pointer Exception thrown when bucket is empty

This error case is surprisingly common because most people running
this example will have just created a fresh bucket explicitly for
this purpose (like I had), and running into an exception immediately
that requires debugging isn't very friendly for the user.
Import java.util.List
Merge pull request #1 from CydeWeys/master

Fix Null Pointer Exception thrown when bucket is empty