How can I search a list of ParseObjects?

#1

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){
        contains=listaDeChats.contains(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.orderByDescending("createdAt");
        query.findInBackground(new FindCallback<ParseObject>() {
            @Override
            public void done(List<ParseObject> objects, ParseException e) {
                for (ParseObject obj : objects) {
                    nombre = obj.getString("EnviaMensaje");
                     recibemensaje=obj.getString("RecibeMensaje");
                    //Date hora=obj.getDate("createdAt");
                    idChat=obj.getObjectId();
                    String mensaje=obj.getString("Mensaje");
                    listaDeChats.add(obj);
                }
            }
        });
 }