AbstractContextStore implements ContextStore { protected <T> T get(Map<String, Serializable> contextStore, String key, T def) { if (contextStore.containsKey(key)) { return (T) contextStore.get(key); } return def; } AbstractContextStore(String... entries); @Override Collection<String> getSupportedEntries();  }
@Test void get() { Map<String, Serializable> contextStore = new HashMap<>(); assertEquals("def", this.component.get(contextStore, "key", "def")); contextStore.put("key", null); assertNull(this.component.get(contextStore, "key", "def")); }