added test; fixed javadoc