### Question:
DirectedGraphImpl implements DirectedGraph { public Set<Transition> getTransitions (String sourceName) { return getTransitions (getState (sourceName)); } DirectedGraphImpl(String name); void read(String path, String fileName); String getName(); State addState(String name); State getState(String name); State getStateByLabel(String label); State getRootState(); State getBeginState(); Transition addTransition(String sourceName, String targetName); Transition addTransition(State source, State target); Transition getTransition(String sourceName, String targetName); Transition getTransition(State source, State target); Set<Transition> getTransitions(String sourceName); Set<Transition> getTransitions(State source);  }### Answer:
@Test public void testGetTransitions () { DirectedGraphImpl graph = new DirectedGraphImpl (GRAPH_NAME); State state1 = graph.addState ("state 1"); State state2 = graph.addState ("state 2"); State state3 = graph.addState ("state 3"); Transition from1To2 = graph.addTransition (state1, state2); Transition from1To3 = graph.addTransition (state1, state3); Transition from2To1 = graph.addTransition (state2, state1); Transition from2To3 = graph.addTransition (state2, state3); Set<Transition> transitions = graph.getTransitions ("state 1"); assertTrue (transitions.contains (from1To2)); assertTrue (transitions.contains (from1To3)); assertFalse (transitions.contains (from2To1)); assertFalse (transitions.contains (from2To3)); transitions = graph.getTransitions (state1); assertTrue (transitions.contains (from1To2)); assertTrue (transitions.contains (from1To3)); assertFalse (transitions.contains (from2To1)); assertFalse (transitions.contains (from2To3)); }