Adding JavaDoc and proper test coverage