Graph<TestNode> (TestNode[] allNodes, Map<TestNode, TestNode[]> mapIn) { return GraphGenerator.generate(new InboundSemiGraph<>() { @NotNull @Override public Collection<TestNode> getNodes() { return Arrays.asList(allNodes); } @NotNull @Override public Iterator<TestNode> getIn(TestNode n) { return GraphTestUtil.iteratorOfArray(ObjectUtils.notNull(mapIn.get(n), new TestNode[0])); } }); }