testcase added for hasNext