### Question:
JsonNodeConfig implements Configuration { @Override public Optional<String> get(String key) { return get(key, String.class); } JsonNodeConfig(JsonNode rootNode); protected  JsonNodeConfig(JsonNode rootNode, ObjectMapper mapper); @Override Optional<String> get(String key); @Override Optional<T> get(String property, Class<T> tClass); @Override X as(Class<X> type); @Override String toString();  }### Answer:
@Test public void extractsDefaultStringTypeConfigurationFromJsonNode() { JsonNode rootNode = jsonNode("{\"text\":\"foo\"}"); JsonNodeConfig config = new JsonNodeConfig(rootNode); assertThat(config.get("text"), isValue("foo")); assertThat(config.get("nonExistent"), isAbsent()); }
@Test public void extractsSpecifiedTypeConfigurationFromJsonNode() { JsonNode rootNode = jsonNode("{\"text\":\"foo\",\"number\":123}"); JsonNodeConfig config = new JsonNodeConfig(rootNode); assertThat(config.get("text", String.class), isValue("foo")); assertThat(config.get("nonExistent", String.class), isAbsent()); assertThat(config.get("number", Integer.class), isValue(123)); assertThat(config.get("nonExistent", Integer.class), isAbsent()); }