Added JavaDoc and Test Cases.