I wanna remove object from my ArrayList. But its not working as expected. Below is my code.

```
public static void validateXML(ArrayList<MyClass> ArrayvalidRequestResponsePairs,boolean result)
    {
        MyClass MyclassObject = new MyClass();
        if(result == true)
        {
            // code
        }
        else
        {
            ArrayvalidRequestResponsePairs.remove(MyclassObject.requestFile);
        }
    }

```

but the value is not getting removed. What's wrong with is code?