Added new test case, added Javadoc