Added unit tests and some java doc cleanup.
Added unit tests and some java doc cleanup.