merge() does not attach the instance you gave it. It copies the state onto a managed instance and returns THAT - so writes to your original after the call are silently discarded.
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-25