### Question:
SpiExtension { public JsonNode config() { return config; } @JsonCreator  SpiExtension(@JsonProperty("factory") SpiExtensionFactory factory,
                        @JsonProperty("config") JsonNode config,
                        @JsonProperty("enabled") Boolean enabled); SpiExtensionFactory factory(); JsonNode config(); boolean enabled(); T config(Class<T> configClass); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void getsConfigAsClass() throws IOException { JsonNode configNode = MAPPER.readTree("foo: bar"); SpiExtension metadata = new SpiExtension(new SpiExtensionFactory("factoryClass", "classPath"), configNode, null); TestObject config = metadata.config(TestObject.class); assertThat(config.foo, is("bar")); }