AgnosticGraphFactory implements VisualizedGraphFactory { @Override public VisualizedGraph create(ILayer... layers) { boolean singleNode = layers.length == 1 && layers[0].getNodes().hasOnlyOneNode(); return new AgnosticVisualizedGraph(createCascade(layers), calculateSize(layers), singleNode); } AgnosticGraphFactory(NodeDimensions properties); @Override VisualizedGraph create(ILayer... layers);  }
@Test public void createsSingleNode() throws Exception { addNodesToLayer(layer, 1); assertThat(factory.create(layer).isSingleNode(), is(true)); }
@Test public void createsNoSingleNodeForMultipleLayers() throws Exception { addNodesToLayer(layer, 1); ILayer nextLayer = mock(ILayer.class); addNodesToLayer(nextLayer, 1); assertThat(factory.create(layer, nextLayer).isSingleNode(), is(false)); }
@Test public void createsNoSingleNodeForMultipleNodes() throws Exception { addNodesToLayer(layer, 2); assertThat(factory.create(layer).isSingleNode(), is(false)); }