### Question:
DirectedGraphImpl implements DirectedGraph { public State getStateByLabel (String label) { for (State state : mStates.values ()) { if (state.mLabel.equalsIgnoreCase (label)) { return state; } } return null; } 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 testGetStateByLabel () { String LABEL = "label"; DirectedGraphImpl graph = new DirectedGraphImpl (GRAPH_NAME); assertNull (graph.getStateByLabel (LABEL)); State state = graph.addState ("state name"); state.mLabel = LABEL; assertEquals (state, graph.getStateByLabel (LABEL)); }