?

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

any followingsequence of repeating numbers will start at zero. So your current result is probably always exactly one below the desired output.