### Question:
NamedExtension implements Extension<T> { @Override public String getKey() { return key; } NamedExtension(String key); @Override String getKey(); @Override boolean equals(Object o); boolean equals(NamedExtension<?> o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void named_extensions_returns_its_own_key() { assertEquals("my.extension", Extension.key("my.extension").getKey()); }
@Test(expected = UnsupportedOperationException.class) public void anonymous_throws_if_try_to_get_the_key() { Extension.anonymous().getKey(); }