How can I search a list of ParseObjects?


Hello i have a List in this list i want to know if contains two elements in a given object id . These are the elements:

EnviaMensaje ---> Pointer _User
RecibeMensaje--->Pointer _User

ive been trying to use contains method in this method

private boolean ifListContains(ParseObject id){
        return contains;

but when i pass EnviaMensaje to the method i am extraction it as a String. Should i pass it as a parseObject?

This is how i am performing the query!

private void queryChatClass(){
        ParseQuery<ParseObject> query=ParseQuery.getQuery("Chat");
        query.findInBackground(new FindCallback<ParseObject>() {
            public void done(List<ParseObject> objects, ParseException e) {
                for (ParseObject obj : objects) {
                    nombre = obj.getString("EnviaMensaje");
                    //Date hora=obj.getDate("createdAt");
                    String mensaje=obj.getString("Mensaje");