@Test
  public void addAnEdgeToAGraph() throws Exception {
    graph.addEdge(new WeightedEdge(1, 2, 1.0));

    assertThat(graph.numberOfEdges(), is(1));
    assertThat(graph.numberOfVertices(), is(2));
  }
  @Test
  public void itShouldBeAdjacentToEachOther() throws Exception {
    WeightedEdge edge = new WeightedEdge(1, 2, 1.0);
    graph.addEdge(edge);

    assertThat(graph.adjacentTo(1), is(Collections.singletonList(edge)));
    assertThat(graph.adjacentTo(2), is(Collections.singletonList(edge)));
  }
  @Test
  public void itShouldAddEdgesToAGraph() throws Exception {
    graph.addEdge(new WeightedEdge(1, 2, 1.0));
    graph.addEdge(new WeightedEdge(2, 3, 4.0));
    graph.addEdge(new WeightedEdge(1, 4, 5.0));

    assertThat(graph.numberOfVertices(), is(4));
    assertThat(graph.numberOfEdges(), is(3));
  }
  @Test
  public void createANewEmptyGraph() throws Exception {

    assertThat(graph.numberOfVertices(), is(0));
    assertThat(graph.numberOfEdges(), is(0));
  }