### Question:
ObjectFactTypeResolver { public FactTypeStruct toFactTypeStruct(UUID id) { FactTypeEntity entity = factManager.getFactType(id); if (entity == null) { return null; } return FactTypeStruct.builder().setId(entity.getId()).setName(entity.getName()).build(); } @Inject  ObjectFactTypeResolver(FactManager factManager, ObjectManager objectManager); UUID factTypeNameToId(String type); Set<UUID> factTypeNamesToIds(Set<String> types); ObjectTypeStruct toObjectTypeStruct(UUID id); FactTypeStruct toFactTypeStruct(UUID id);  }### Answer:
@Test public void testToFactTypeStructNotExists() { assertNull(resolver.toFactTypeStruct(null)); }
@Test public void testToFactTypeStruct() { UUID id = UUID.randomUUID(); when(factManager.getFactType(id)).thenReturn(new FactTypeEntity().setId(id).setName("someFactType")); assertEquals(FactTypeStruct.builder().setId(id).setName("someFactType").build(), resolver.toFactTypeStruct(id)); }