CorrelationContext { public Optional<String> get(String key) { if (key == null) { return Optional.empty(); } return Optional.ofNullable(data.get(key)); } CorrelationContext(); Optional<String> put(String key, String value); Optional<String> get(String key); CorrelationContext clone(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testGet() { final CorrelationContext context = new CorrelationContext(); context.put("test1", "t1"); Assert.assertEquals("t1", context.get("test1").get()); Assert.assertNull(context.get(null).orElse(null)); context.put("test2", null); Assert.assertNull(context.get("test2").orElse(null)); }