@Test
public void testAddEdge() throws Exception {

    Source src = new StreamlineSource(Collections.singleton(new Stream("f1", "f2")));
    Sink sink = new StreamlineSink();
    Processor processor = new StreamlineProcessor(Collections.singleton(new Stream("r1")));
    topology.add(src).add(processor).add(sink);
    topology.addEdge(src, processor);
    topology.addEdge(processor, sink);
    assertEquals(1, topology.getEdgesFrom(src).size());
    assertEquals(src, topology.getEdgesFrom(src).get(0).getFrom());
    assertEquals(processor, topology.getEdgesFrom(src).get(0).getTo());
    assertEquals(1, topology.getEdgesFrom(processor).size());
    assertEquals(processor, topology.getEdgesFrom(processor).get(0).getFrom());
    assertEquals(sink, topology.getEdgesFrom(processor).get(0).getTo());
    assertEquals(2, topology.getEdges(processor).size());
    assertEquals(0, topology.getEdgesTo(src).size());
    assertEquals(0, topology.getEdgesFrom(sink).size());
}