Integer.valueOf caches -128..127, so identity comparison on a small join key appears to work and keeps working right up to the day an id crosses 127. The bug ships because the test data was small.
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-09-20