### Question:
SingleType extends ClassType { @Override public String toSchema() { try { return tryBuildSchemaFromJaxbAnnotatedClass(); } catch (Exception e) { logger.warn("Cannot generate schema from JAXB annotations for class: " + clazz.getName() + ". Preparing generic Schema.\n" + e, e); return schemaForNonAnnotatedClass(); } } SingleType(Class<?> classType, QName qName); @Override String toSchema();  }### Answer:
@Test public void givenClassWhichAttributeIsAnInterface_whenBuild_thenReturnSchemaWithTheInterface() { assertThat(new SingleType(ContactWhichAttributeIsAnInterface.class, IGNORED_Q_NAME).toSchema(), is(ContactWhichAttributeIsAnInterface.EXPECTED_SCHEMA)); }
@Test public void givenNameOfNonAnnotatedJaxbClass_whenBuild_thenReturnGenericSchema() { assertThat(new SingleType(Contact.class, IGNORED_Q_NAME).toSchema(), is(Contact.EXPECTED_SCHEMA)); }
@Test public void givenNameOfAnnotatedJaxbClass_whenBuild_thenReturnSchemaGeneratedByJaxb() { assertThat(new SingleType(ContactAnnotated.class, IGNORED_Q_NAME).toSchema(), is(ContactAnnotated.EXPECTED_SCHEMA)); }
@Test public void givenNameOfAnnotatedJaxbClassWithSpecificTypeName_whenBuild_thenReturnSchemaGeneratedByJaxbWithSpecificName() { assertThat(new SingleType(ContactAnnotatedWithDifferentName.class, IGNORED_Q_NAME).toSchema(), is(ContactAnnotatedWithDifferentName.EXPECTED_SCHEMA)); }