### Question:
AbstractModuleDescriptor implements ModuleDescriptor<T>, StateAware { final protected void assertModuleClassImplements(final Class<T> requiredModuleClazz) throws PluginParseException { if (!enabled) { throw new PluginParseException("Plugin module " + getKey() + " not enabled"); } if (!requiredModuleClazz.isAssignableFrom(getModuleClass())) { throw new PluginParseException("Given module class: " + getModuleClass().getName() + " does not implement " + requiredModuleClazz.getName()); } } AbstractModuleDescriptor(final ModuleFactory moduleFactory); @Deprecated  AbstractModuleDescriptor(); void init(@NotNull final Plugin plugin, @NotNull final Element element); void destroy(final Plugin plugin); boolean isEnabledByDefault(); boolean isSystemModule(); @Deprecated boolean isSingleton(); String getCompleteKey(); String getPluginKey(); String getKey(); String getName(); Class<T> getModuleClass(); abstract T getModule(); String getDescription(); Map<String, String> getParams(); String getI18nNameKey(); String getDescriptionKey(); List<ResourceDescriptor> getResourceDescriptors(); List<ResourceDescriptor> getResourceDescriptors(final String type); ResourceLocation getResourceLocation(final String type, final String name); ResourceDescriptor getResourceDescriptor(final String type, final String name); Float getMinJavaVersion(); boolean satisfiesMinJavaVersion(); void setPlugin(final Plugin plugin); Plugin getPlugin(); @Override String toString(); void enabled(); void disabled();  }### Answer:
@Test public void testAssertModuleClassImplements() throws DocumentException, PluginParseException { ModuleDescriptor descriptor = new AbstractModuleDescriptor<MockMineral>(ModuleFactory.LEGACY_MODULE_FACTORY) { public void init(Plugin plugin, Element element) throws PluginParseException { super.init(plugin, element); enabled(); assertModuleClassImplements(MockMineral.class); } public MockMineral getModule() { return null; } }; try { descriptor.init(new StaticPlugin(), DocumentHelper.parseText("<animal key=\"key\" name=\"bear\" class=\"org.maera.plugin.mock.MockBear\" />").getRootElement()); ((StateAware) descriptor).enabled(); fail("Should have blown up."); } catch (PluginParseException e) { assertEquals("Given module class: org.maera.plugin.mock.MockBear does not implement org.maera.plugin.mock.MockMineral", e.getMessage()); } descriptor.init(new StaticPlugin(), DocumentHelper.parseText("<animal key=\"key\" name=\"bear\" class=\"org.maera.plugin.mock.MockGold\" />").getRootElement()); }