class FindLongestConsecutiveSequence {

  public int findIterative(int[] numbers) {
    validateInput(numbers);
    if (numbers.length == 0) {
      return 0;
    }

    boolean consecutiveSequenceFound = false;
    int result = 0;
    int start = 0, end = 0;
    for (int i = 1; i < numbers.length; i++) {
      if (numbers[i - 1] < numbers[i]) {
        end = i;
      } else {
        start = i;
      }
      if (end - start > result) {
        consecutiveSequenceFound = true;
        result = end - start;
      }
    }
    if (consecutiveSequenceFound) {
      return result + 1;
    } else {
      return result;
    }
  }

}