clear() test

add testClear() to test the method clear