Add Javadoc.
Add test to do.
Prevent NPEs.