### Question:
FactInfoResolver implements Function<UUID, FactInfoSEB> { @Override public FactInfoSEB apply(UUID id) { if (id == null) return null; FactEntity fact = factManager.getFact(id); if (fact == null) return null; return FactInfoSEB.builder() .setId(fact.getId()) .setType(typeResolver.apply(fact.getTypeID())) .setValue(fact.getValue()) .build(); } @Inject  FactInfoResolver(FactManager factManager, FactTypeInfoResolver typeResolver); @Override FactInfoSEB apply(UUID id);  }### Answer:
@Test public void testResolveNull() { assertNull(resolver.apply(null)); }
@Test public void testResolveNoFactFound() { UUID id = UUID.randomUUID(); assertNull(resolver.apply(id)); verify(factManager).getFact(id); }
@Test public void testResolveFactFound() { FactEntity entity = new FactEntity() .setId(UUID.randomUUID()) .setTypeID(UUID.randomUUID()) .setValue("value"); when(factManager.getFact(any())).thenReturn(entity); when(typeResolver.apply(any())).thenReturn(FactTypeInfoSEB.builder().build()); FactInfoSEB seb = resolver.apply(entity.getId()); assertNotNull(seb); assertEquals(entity.getId(), seb.getId()); assertNotNull(seb.getType()); assertEquals(entity.getValue(), seb.getValue()); verify(factManager).getFact(entity.getId()); verify(typeResolver).apply(entity.getTypeID()); }