/** * Return the underlying {@code MessageHeaders} instance. * * <p>Unless {@link #setLeaveMutable(boolean)} was set to {@code true}, after this call, the * headers are immutable and this accessor can no longer modify them. * * <p>This method always returns the same {@code MessageHeaders} instance if invoked multiples * times. To obtain a copy of the underlying headers, use {@link #toMessageHeaders()} or {@link * #toMap()} instead. * * @since 4.1 */ public MessageHeaders getMessageHeaders() { if (!this.leaveMutable) { setImmutable(); } return this.headers; }