### Question:
State { public Arc binarySearchArc(char transition, int beginIndice, int endIndice) { if (beginIndice >= endIndice) { return null; } int indice = beginIndice + (endIndice - beginIndice) / 2; if (arcs.get(indice).getLabel() == transition) { return arcs.get(indice); } else if (arcs.get(indice).getLabel() > transition) { return binarySearchArc(transition, beginIndice, indice); } else if (arcs.get(indice).getLabel() < transition) { return binarySearchArc(transition, indice + 1, endIndice); } return null; } State();  State(State source); int getTargetJumpAddress(); void setTargetJumpAddress(int targetJumpAddress); Arc setArc(char transition, int output, State toState); void setArc(char transition, State toState); List<Character> getAllTransitionStrings(); void setFinal(); boolean isFinal(); Arc findArc(char transition); Arc binarySearchArc(char transition, int beginIndice, int endIndice); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testBinarySearchArc() throws Exception { State state = new State(); State destState = new State(); Arc ArcA = state.setArc('a', 1, destState); Arc ArcB = state.setArc('b', 1, destState); Arc ArcC = state.setArc('c', 1, destState); assertEquals(ArcA, state.binarySearchArc('a', 0, state.arcs.size())); assertEquals(ArcB, state.binarySearchArc('b', 0, state.arcs.size())); assertEquals(ArcC, state.binarySearchArc('c', 0, state.arcs.size())); assertNull(state.binarySearchArc('d', 0, state.arcs.size())); }