#141 finished implementation and added test
#141 javadoc