### Question:
VertxVaadinContext implements VaadinContext { @Override public <T> T getAttribute(Class<T> type, Supplier<T> defaultValueSupplier) { T result = context.get(type.getName()); if (result == null && defaultValueSupplier != null) { result = defaultValueSupplier.get(); context.put(type.getName(), result); } return result; } VertxVaadinContext(Vertx vertx); @Override T getAttribute(Class<T> type, Supplier<T> defaultValueSupplier); @Override void setAttribute(T value); @Override void removeAttribute(Class<?> clazz);  }### Answer:
@Test public void getAttributeWithProvider() { Assert.assertNull(context.getAttribute(String.class)); String value = context.getAttribute(String.class, VertxVaadinContextTest::testAttributeProvider); assertEquals(testAttributeProvider(), value); assertEquals("Value from provider should be persisted", testAttributeProvider(), context.getAttribute(String.class)); }
@Test public void getMissingAttributeWithoutProvider() { String value = context.getAttribute(String.class); Assert.assertNull(value); }