### Question:
FactConverter { Fact convert(com.sabre.oss.yare.core.model.Fact fact) { if (fact == null) { return null; } return new Fact() .withName(fact.getIdentifier()) .withType(typeConverter.toString(Type.class, fact.getType())); } FactConverter(TypeConverter typeConverter);   }### Answer:
@Test void shouldConvertToFact() { com.sabre.oss.yare.core.model.Fact toConvert = new com.sabre.oss.yare.core.model.Fact("fact-name", String.class); Fact fact = factConverter.convert(toConvert); Fact expected = new Fact() .withName("fact-name") .withType("String"); assertThat(fact).isEqualTo(expected); }
@Test void shouldConvertNullFact() { Fact fact = factConverter.convert(null); assertThat(fact).isNull(); }