### Question:
ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(controlPoints, index)) { throw new IllegalArgumentException("Cannot delete a new CP at the given index [" + index + "]."); } }  static void checkAddControlPoint(final ControlPoint[] controlPoints,
                                            final ControlPoint controlPoint,
                                            final int index); static void checkDeleteControlPoint(final ControlPoint[] controlPoints,
                                               final int index); static void checkUpdateControlPoint(final ControlPoint[] controlPoints1,
                                               final ControlPoint[] controlPoints2); static Predicate<Integer> isControlPointIndexInvalid; static Predicate<ControlPoint> isControlPointInvalid; static BiPredicate<ControlPoint[], Integer> isAddingControlPointIndexForbidden; static BiPredicate<ControlPoint[], Integer> isDeletingControlPointIndexForbidden; static BiPredicate<ControlPoint[], ControlPoint[]> cannotControlPointsBeUpdated; }### Answer:
@Test public void testValidCheckDeleteControlPoint() { checkDeleteControlPoint(controlPoints, 0); }
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckDeleteControlPoint() { checkDeleteControlPoint(controlPoints, 1); }
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckDeleteControlPoint2() { checkDeleteControlPoint(controlPoints, 2); }