public class Test{
    public static void main(String[] args) {

        class TestObj {

            private static TestObj firstCompared;

            public @Override boolean equals(final Object o) {       
                if (TestObj.firstCompared == null)
                    TestObj.firstCompared = this;
            
                return true;
            }
        }

        record TestRecord(TestObj x, TestObj y) {}
    
        var a = new TestRecord(new TestObj(), new TestObj());
        var b = new TestRecord(new TestObj(), new TestObj());
        
        a.equals(b);
    
        boolean bogus = TestObj.firstCompared == a.y; // firstCompared should be a.x, but at least in OpenJDK 24 it is a.y
        assert bogus || TestObj.firstCompared == a.x;
    
        System.err.println("bogus=" + bogus);
    }
}