@Test
  public void addLayerAddsUniqueLayer() {
    Layer topLayer = new Layer();

    assertTrue(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
  @Test
  public void addLayerRejectsDuplicateLayer() {
    Layer topLayer = new Layer();

    assertTrue(network.addLayer(topLayer));
    assertFalse(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
  @Test
  public void addLayerToANullLayerList() {
    Layer topLayer = new Layer();

    network.setLayers(null);
    assertTrue(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
  @Test
  public void returnsOutputLayer() {
    Set<Layer> layers = new HashSet<Layer>();
    Layer topLayer = new Layer();
    Layer middleLayer = new Layer();
    Layer bottomLayer = new Layer();

    Connections firstConnection = new FullyConnected(topLayer, middleLayer, 0, 0);
    Connections secondConnection = new FullyConnected(middleLayer, bottomLayer, 0, 0);

    topLayer.addConnection(firstConnection);
    middleLayer.addConnection(firstConnection);

    middleLayer.addConnection(secondConnection);
    bottomLayer.addConnection(secondConnection);

    layers.add(topLayer);
    layers.add(middleLayer);
    layers.add(bottomLayer);
    network.setLayers(layers);

    assertEquals(bottomLayer, network.getOutputLayer());
  }
 @Test
 public void returnsNullOutputLayerOnEmptyNetwork() {
   assertNull(network.getOutputLayer());
 }