### Question:
ObjectFactTypeResolver { public ObjectTypeStruct toObjectTypeStruct(UUID id) { ObjectTypeEntity entity = objectManager.getObjectType(id); if (entity == null) { return null; } return ObjectTypeStruct.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 testToObjectTypeStructNotExists() { assertNull(resolver.toObjectTypeStruct(null)); assertNull(resolver.toObjectTypeStruct(UUID.randomUUID())); }
@Test public void testToObjectTypeStruct() { UUID id = UUID.randomUUID(); when(objectManager.getObjectType(id)).thenReturn(new ObjectTypeEntity().setId(id).setName("someObjectType")); assertEquals(ObjectTypeStruct.builder().setId(id).setName("someObjectType").build(), resolver.toObjectTypeStruct(id)); }