### Question:
CaseManagementCommandUtil { @SuppressWarnings("unchecked") public static int getChildGraphIndex(final Node parent, final Node child) { if (parent != null && child != null) { List<Edge> outEdges = parent.getOutEdges(); if (null != outEdges && !outEdges.isEmpty()) { for (int i = 0, n = outEdges.size(); i < n; i++) { if (child.equals(outEdges.get(i).getTargetNode())) { return i; } } } } return -1; }  @SuppressWarnings("unchecked") static Node<Definition<CaseManagementDiagram>, ?> getFirstDiagramNode(final Graph<?, Node> graph); @SuppressWarnings("unchecked") static int getChildGraphIndex(final Node parent,
                                         final Node child); @SuppressWarnings("unchecked") static int getChildCanvasIndex(final Node<View<?>, Edge> parent,
                                          final Node<View<?>, Edge> child); static boolean isStage(final Node<View<?>, Edge> parent, final Node<View<?>, Edge> child); static boolean isStageNode(final Node<View<?>, Edge> node); static boolean isSubStageNode(final Node<View<?>, Edge> node); static Predicate<Edge> childPredicate(); static Predicate<Edge> sequencePredicate(); @SuppressWarnings("unchecked") static int getNewChildCanvasIndex(final Node<View<?>, Edge> parent); @SuppressWarnings("unchecked") static int getNewChildGraphIndex(final Node<View<?>, Edge> parent);  }### Answer:
@Test public void testGetGraphIndex() { final Edge edge = mock(Edge.class); when(edge.getTargetNode()).thenReturn(child); when(parent.getOutEdges()).thenReturn(Collections.singletonList(edge)); assertEquals(0, CaseManagementCommandUtil.getChildGraphIndex(parent, child)); }