added some javadoc and improbed typing in a test case