### Question:
CanvasLayoutUtils { @SuppressWarnings("unchecked") public static Element<? extends Definition<?>> getElement(final AbstractCanvasHandler canvasHandler, final String uuid) { if (Objects.isNull(canvasHandler) || Objects.isNull(uuid)) { return null; } final Index<?, ?> index = canvasHandler.getGraphIndex(); if (Objects.isNull(index)) { return null; } return index.get(uuid); } @Inject  CanvasLayoutUtils(final GraphBoundsIndexer graphBoundsIndexer); static boolean isCanvasRoot(final Diagram diagram,
                                       final Element parent); static boolean isCanvasRoot(final Diagram diagram,
                                       final String pUUID); static int getPaddingX(); static int getPaddingY(); @PreDestroy void destroy(); @SuppressWarnings("unchecked") Point2D getNext(final AbstractCanvasHandler canvasHandler,
                           final Node<View<?>, Edge> root,
                           final Node<View<?>, Edge> newNode); @SuppressWarnings("unchecked") Point2D getNext(final AbstractCanvasHandler canvasHandler,
                           final Node<View<?>, Edge> root,
                           final double rootNodeWidth,
                           final double rootNodeHeight,
                           final double newNodeWidth,
                           final double newNodeHeight,
                           Point2D offset,
                           Point2D rootNodeCoordinates
    ); @SuppressWarnings("unchecked") static Element<? extends Definition<?>> getElement(final AbstractCanvasHandler canvasHandler,
                                                              final String uuid); static void fireElementSelectedEvent(final Event<CanvasSelectionEvent> selectionEvent,
                                                final AbstractCanvasHandler canvasHandler,
                                                final String uuid);  }### Answer:
@Test public void testGetElementNullCanvasHandlerAndNullUUID() { when(abstractCanvasHandler.getGraphIndex()).thenReturn(graphIndex); assertNull(CanvasLayoutUtils.getElement(null, null)); }
@Test public void testGetElementNullCanvasHandler() { when(abstractCanvasHandler.getGraphIndex()).thenReturn(graphIndex); assertNull(CanvasLayoutUtils.getElement(null, NODE_UUID)); }
@Test public void testGetElementNullUUID() { when(abstractCanvasHandler.getGraphIndex()).thenReturn(graphIndex); assertNull(CanvasLayoutUtils.getElement(abstractCanvasHandler, null)); }
@Test public void testGetElementWithNullIndex() { assertNull(CanvasLayoutUtils.getElement(abstractCanvasHandler, NODE_UUID)); }
@Test public void testGetElement() { when(abstractCanvasHandler.getGraphIndex()).thenReturn(graphIndex); when(graphIndex.get(NODE_UUID)).thenReturn(nodeRoot); assertEquals(nodeRoot, CanvasLayoutUtils.getElement(abstractCanvasHandler, NODE_UUID)); }