Junit testing for clear function