add extra testcases
fix test assumption
fix test to match testcase
update JavaDoc