### Question:
GraphUpgradeDefinitionFactory implements UpgradeDefinitionFactory { @Override public UpgradeDefinition create(final UpgradeContext context) { final Version current = context.getVersion(); final Version required = getTargetVersion(); if (current.equals(required)) { return NOOP; } final List<Edge> path = GraphHelper.extractPath(graph, current); final List<Task> upgradeTasks = new ArrayList<Task>(path.size()); for (final Edge edge : path) { final Task rawTask = edge.createTask(context); final Task upgradeTask = UpgradeTask.from(rawTask, edge.getSource(), edge.getTarget(), context); upgradeTasks.add(upgradeTask); } return new UpgradeDefinition() { @Override public List<Task> getUpgradeTasks() { return Collections.unmodifiableList(upgradeTasks); } }; } GraphUpgradeDefinitionFactory(final Graph graph); @Override boolean isUpgradeSupported(UpgradeContext context); @Override UpgradeDefinition create(final UpgradeContext context); @Override Version getTargetVersion(); @Override String toString();  }### Answer:
@Test(groups = { TestGroups.UNIT }) public void verifyEmpty() throws IOException { final UpgradeDefinitionFactory empty = new GraphUpgradeDefinitionFactory(new AbstractGraph() { @Override protected Map<Version, Edge> getEdges() { return Collections.emptyMap(); } }); final UpgradeDefinition definition = empty.create(new DummyUpgradeContext()); Assert.assertEquals(definition.getUpgradeTasks().size(), 0); }