Updated Javadoc for tests and cleaned up some code