Implement getOnlyObject

Function can now take list of generic object