code: private static void validateStartEnd(int start, int end) {
          if (start < 0) {
              throw new IllegalArgumentException("Parameter start must not be negative.");
          }
          if (end < 0) {
              throw new IllegalArgumentException("Parameter end must not be negative.");
          }
          if (start > end) {
              throw new IllegalArgumentException("Parameter start must not be greater than end.");
          }
      }
docs: Validates the given {@code start} and {@code end} positions.
  
  @param start the start position to be validated
  @param end the end position to be validated
  @throws IllegalArgumentException if any of the conditions is true:
  <ul>
  <li>the {@code start} position is negative;</li>
  <li>the {@code end} position is negative;</li>
  <li>the {@code start} position is greater than the {@code end} position.</li>
  </ul>