### Question:
PropertyReaderUtils { public static Point2D getTargetPosition(DefinitionResolver definitionResolver, String edgeId, String targetId) { final double resolutionFactor = definitionResolver.getResolutionFactor(); final Bounds targetBounds = definitionResolver.getShape(targetId).getBounds(); final List<Point> waypoint = definitionResolver.getEdge(edgeId).getWaypoint(); return waypoint.isEmpty() ? targetPosition(targetBounds, resolutionFactor) : offsetPosition(targetBounds, waypoint.get(waypoint.size() - 1), resolutionFactor); }  static Point2D getSourcePosition(DefinitionResolver definitionResolver,
                                            String edgeId,
                                            String sourceId); static Point2D getTargetPosition(DefinitionResolver definitionResolver,
                                            String edgeId,
                                            String targetId); static List<Point2D> getControlPoints(DefinitionResolver definitionResolver,
                                                 String edgeId); static boolean isAutoConnectionSource(BaseElement element); static boolean isAutoConnectionTarget(BaseElement element); static WSDLImport toWSDLImports(Import imp);  }### Answer:
@Test public void testGetTargetPositionWithNoWaypoint() { when(edge.getWaypoint()).thenReturn(Collections.emptyList()); Point2D point = PropertyReaderUtils.getTargetPosition(definitionResolver, EDGE_ID, SHAPE_ID); assertPoint(0, BOUNDS_HEIGHT / 2, point); }
@Test public void testGetTargetPositionWithWaypoint() { when(edge.getWaypoint()).thenReturn(Collections.singletonList(point)); Point2D point = PropertyReaderUtils.getTargetPosition(definitionResolver, EDGE_ID, SHAPE_ID); assertPoint(WAY_POINT_X - BOUNDS_X, WAY_POINT_Y - BOUNDS_Y, point); }