ArrayList clear() method in java