### Question:
SqlObjectFactory implements ExtensionFactory, OnDemandExtensions.Factory { @Override public boolean accepts(Class<?> extensionType) { if (looksLikeSqlObject(extensionType)) { if (extensionType.getAnnotation(GenerateSqlObject.class) != null) { return true; } if (!extensionType.isInterface()) { throw new IllegalArgumentException("SQL Objects are only supported for interfaces."); } return true; } return false; } SqlObjectFactory(); @Override boolean accepts(Class<?> extensionType); @Override E attach(Class<E> extensionType, HandleSupplier handle); @Override Optional<Object> onDemand(Jdbi db, Class<?> extensionType, Class<?>... extraTypes);  }### Answer:
@Test public void accepts() { assertThat(factory.accepts(NotASqlObject.class)).isFalse(); assertThatThrownBy(() -> factory.accepts(SqlObjectClass.class)) .hasMessageContaining("only supported for interfaces"); assertThat(factory.accepts(HasAnnotatedMethod.class)).isTrue(); assertThat(factory.accepts(ExtendsSqlObject.class)).isTrue(); }