Adding tests and function for filterobject