Help is greatly appreciated!

package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
/*
Longest sequence
*/
public class Solution {
public static void main(String[] args) throws IOException {
ArrayList<Integer> numbers = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 10; i++) {
numbers.add(Integer.parseInt(reader.readLine()));
}
int counter = 1;
int finalNum = 1;
for (int i = 0; i < numbers.size() - 1; i++) {
if (numbers.get(i).equals(numbers.get(i + 1))) counter++;
if (!numbers.get(i).equals(numbers.get(i + 1))) {
if (counter > finalNum) {
counter = 1;
}
}
}
if (counter > finalNum) finalNum = counter;
System.out.println(finalNum);
}
}