Added Java Test cases