@Test public void testFromCollections() throws Exception { final GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> layout = factory.fromCollections(graphHeads, vertices, edges); Collection<TemporalGraphHead> loadedGraphHeads = new ArrayList<>(); Collection<TemporalVertex> loadedVertices = new ArrayList<>(); Collection<TemporalEdge> loadedEdges = new ArrayList<>(); layout.getGraphHeads().output(new LocalCollectionOutputFormat<>(loadedGraphHeads)); layout.getVertices().output(new LocalCollectionOutputFormat<>(loadedVertices)); layout.getEdges().output(new LocalCollectionOutputFormat<>(loadedEdges)); getExecutionEnvironment().execute(); validateElementCollections(graphHeads, loadedGraphHeads); validateElementCollections(vertices, loadedVertices); validateElementCollections(edges, loadedEdges); }
@Override public GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections( Collection<TemporalGraphHead> graphHeads, Collection<TemporalVertex> vertices, Collection<TemporalEdge> edges) { return fromDataSets( createGraphHeadDataSet(Objects.requireNonNull(graphHeads)), createVertexDataSet(Objects.requireNonNull(vertices)), createEdgeDataSet(Objects.requireNonNull(edges))); }
TemporalGraphCollectionLayoutFactory extends TemporalBaseLayoutFactory implements GraphCollectionLayoutFactory<TemporalGraphHead, TemporalVertex, TemporalEdge> { @Override public GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections( Collection<TemporalGraphHead> graphHeads, Collection<TemporalVertex> vertices, Collection<TemporalEdge> edges) { return fromDataSets( createGraphHeadDataSet(Objects.requireNonNull(graphHeads)), createVertexDataSet(Objects.requireNonNull(vertices)), createEdgeDataSet(Objects.requireNonNull(edges))); } }
TemporalGraphCollectionLayoutFactory extends TemporalBaseLayoutFactory implements GraphCollectionLayoutFactory<TemporalGraphHead, TemporalVertex, TemporalEdge> { @Override public GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections( Collection<TemporalGraphHead> graphHeads, Collection<TemporalVertex> vertices, Collection<TemporalEdge> edges) { return fromDataSets( createGraphHeadDataSet(Objects.requireNonNull(graphHeads)), createVertexDataSet(Objects.requireNonNull(vertices)), createEdgeDataSet(Objects.requireNonNull(edges))); }  }
TemporalGraphCollectionLayoutFactory extends TemporalBaseLayoutFactory implements GraphCollectionLayoutFactory<TemporalGraphHead, TemporalVertex, TemporalEdge> { @Override public GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections( Collection<TemporalGraphHead> graphHeads, Collection<TemporalVertex> vertices, Collection<TemporalEdge> edges) { return fromDataSets( createGraphHeadDataSet(Objects.requireNonNull(graphHeads)), createVertexDataSet(Objects.requireNonNull(vertices)), createEdgeDataSet(Objects.requireNonNull(edges))); }  @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromDataSets(
    DataSet<TemporalGraphHead> graphHeads, DataSet<TemporalVertex> vertices); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromDataSets(
    DataSet<TemporalGraphHead> graphHeads, DataSet<TemporalVertex> vertices,
    DataSet<TemporalEdge> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromIndexedDataSets(
    Map<String, DataSet<TemporalGraphHead>> graphHeads,
    Map<String, DataSet<TemporalVertex>> vertices, Map<String, DataSet<TemporalEdge>> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections(
    Collection<TemporalGraphHead> graphHeads,
    Collection<TemporalVertex> vertices,
    Collection<TemporalEdge> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromGraphLayout(
    LogicalGraphLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> logicalGraphLayout); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromTransactions(
    DataSet<GraphTransaction> transactions); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromTransactions(
    DataSet<GraphTransaction> transactions,
    GroupReduceFunction<TemporalVertex, TemporalVertex> vertexMergeReducer,
    GroupReduceFunction<TemporalEdge, TemporalEdge> edgeMergeReducer); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> createEmptyCollection(); }
TemporalGraphCollectionLayoutFactory extends TemporalBaseLayoutFactory implements GraphCollectionLayoutFactory<TemporalGraphHead, TemporalVertex, TemporalEdge> { @Override public GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections( Collection<TemporalGraphHead> graphHeads, Collection<TemporalVertex> vertices, Collection<TemporalEdge> edges) { return fromDataSets( createGraphHeadDataSet(Objects.requireNonNull(graphHeads)), createVertexDataSet(Objects.requireNonNull(vertices)), createEdgeDataSet(Objects.requireNonNull(edges))); }  @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromDataSets(
    DataSet<TemporalGraphHead> graphHeads, DataSet<TemporalVertex> vertices); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromDataSets(
    DataSet<TemporalGraphHead> graphHeads, DataSet<TemporalVertex> vertices,
    DataSet<TemporalEdge> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromIndexedDataSets(
    Map<String, DataSet<TemporalGraphHead>> graphHeads,
    Map<String, DataSet<TemporalVertex>> vertices, Map<String, DataSet<TemporalEdge>> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromCollections(
    Collection<TemporalGraphHead> graphHeads,
    Collection<TemporalVertex> vertices,
    Collection<TemporalEdge> edges); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromGraphLayout(
    LogicalGraphLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> logicalGraphLayout); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromTransactions(
    DataSet<GraphTransaction> transactions); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> fromTransactions(
    DataSet<GraphTransaction> transactions,
    GroupReduceFunction<TemporalVertex, TemporalVertex> vertexMergeReducer,
    GroupReduceFunction<TemporalEdge, TemporalEdge> edgeMergeReducer); @Override GraphCollectionLayout<TemporalGraphHead, TemporalVertex, TemporalEdge> createEmptyCollection();  }