@Test public void testUnModifiableHeaders() { final SimpleMessage message = new SimpleMessage(); final Map<Message.Headers, String> headers = message.getHeaders(); assertThrows(UnsupportedOperationException.class, () -> { headers.put(Message.Headers.SENDER, "test"); }); }
@Override public Map<Headers, String> getHeaders() { return Collections.unmodifiableMap(headers); }
SimpleMessage implements Message { @Override public Map<Headers, String> getHeaders() { return Collections.unmodifiableMap(headers); } }
SimpleMessage implements Message { @Override public Map<Headers, String> getHeaders() { return Collections.unmodifiableMap(headers); }  }
SimpleMessage implements Message { @Override public Map<Headers, String> getHeaders() { return Collections.unmodifiableMap(headers); }  @Override void addHeader(Headers header, String value); @Override String getHeader(Headers header); @Override Map<Headers, String> getHeaders(); @Override String getBody(); @Override void setBody(String body); }
SimpleMessage implements Message { @Override public Map<Headers, String> getHeaders() { return Collections.unmodifiableMap(headers); }  @Override void addHeader(Headers header, String value); @Override String getHeader(Headers header); @Override Map<Headers, String> getHeaders(); @Override String getBody(); @Override void setBody(String body);  }