// construct the graph
Map<String, Node> nodes = new LinkedHashMap<String, Node>();
for (String name : names) {
Object object = repository.getObject(name);
if (object == null) {
throw new NoSuchComponentException(name);
}
if (object instanceof Recipe) {
Recipe recipe = (Recipe) object;
if (!recipe.getName().equals(name)) {
throw new RuntimeException("Recipe '" + name + "' returned from the repository has name '" + name + "'");