Added clear method and test class