AdjacencyMap { public Set<Edge> getEdges(final Object source, final Object destination) { final Set<Edge> results = edgeGraph.get(source, destination); return null != results ? results : Collections.emptySet(); }  Set<Edge> getEdges(final Object source, final Object destination); Set<Edge> putEdges(final Object source, final Object destination, final Set<Edge> set); Set<Edge> putEdge(final Object source, final Object destination, final Edge edge); Set<Object> getDestinations(final Object source); Set<Object> getSources(final Object destination); Set<Object> getAllSources(); Set<Object> getAllDestinations(); void removeAllWithDestination(final Object destination); boolean containsSource(final Object source); boolean containsDestination(final Object destination); String toStringFull(); @Override String toString();  }
@Test public void shouldGetEdges() { final AdjacencyMap adjacencyMap = getAdjacencyMap(); final Set<Edge> results = adjacencyMap.getEdges(1, 2); assertThat(results, hasItems(makeEdge(1, 2))); }
@Test public void shouldGetEmptyEdgeSet() { final AdjacencyMap adjacencyMap = getAdjacencyMap(); final Set<Edge> results = adjacencyMap.getEdges(1, 6); assertThat(results, is(empty())); }
@Test public void shouldGetEntry() { final AdjacencyMap adjacencyMap = getAdjacencyMap(); final Set<Edge> results = adjacencyMap.getEdges(1, 2); assertThat(results, equalTo(Collections.singleton(makeEdge(1, 2)))); }