Concatenating lots of Strings instead of using a StringBuffer will do the trick. Sure, people who are familiar with Java know not to do that. But I’ve seen plenty of production code that concatenates.
Any method call could allocate objects in their call trees, and it may not even behave consistently with new versions.
But it is easy to monitor with Java’s killer observability.