### Question:
OriginResponseConverter implements Function<OriginEntity, Origin> { @Override public Origin apply(OriginEntity entity) { if (entity == null) return null; return Origin.builder() .setId(entity.getId()) .setNamespace(namespaceConverter.apply(entity.getNamespaceID())) .setOrganization(ObjectUtils.ifNotNull(organizationConverter.apply(entity.getOrganizationID()), Organization::toInfo)) .setName(entity.getName()) .setDescription(entity.getDescription()) .setTrust(entity.getTrust()) .setType(ObjectUtils.ifNotNull(entity.getType(), type -> Origin.Type.valueOf(type.name()))) .setFlags(SetUtils.set(entity.getFlags(), flag -> Origin.Flag.valueOf(flag.name()))) .build(); } @Inject  OriginResponseConverter(NamespaceByIdResponseResolver namespaceConverter,
                                 OrganizationByIdResponseResolver organizationConverter); @Override Origin apply(OriginEntity entity);  }### Answer:
@Test public void testConvertOrigin() { OriginEntity entity = createEntity(); assertModel(entity, converter.apply(entity)); }
@Test public void testConvertNullReturnsNull() { assertNull(converter.apply(null)); }