### Question:
ObjectFactTypeResolver { public UUID factTypeNameToId(String type) { FactTypeEntity entity = factManager.getFactType(type); if (entity == null) return null; return entity.getId(); } @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 testGetFactTypeIdBasedOnName() { UUID uuid = UUID.randomUUID(); when(factManager.getFactType("test")).thenReturn(new FactTypeEntity().setId(uuid)); assertEquals(uuid, resolver.factTypeNameToId("test")); }
@Test public void testGetNonExistingFactType() { assertNull(resolver.factTypeNameToId("does not exist")); }