Don't know how to count

**1**, if all numbers are equal. Any clue, please?package com.codegym.task.task08.task0812;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.util.Arrays;
import java.util.List;
/*
Longest sequence
*/
public class Solution {
public static void srt_method(List<Integer> arr) {
int max = Integer.MIN_VALUE;
int temp;
int count = 1;
int n = arr.size();
for (int i = 0; i < n - 1; i++) {
if (arr.get(i).equals(arr.get(i + 1))) {
count++;
temp = count;
if (temp > max) {
max = count;
}
}else count = 1;
}
System.out.println(max);
}
public static void main(String[] args) throws IOException {
ArrayList<Integer> input = new ArrayList<Integer>();
Reader r = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(r);
// int[] input = { 4, 2, 9, 6, 23, 12, 34, 0, -1 };
for (int i = 0; i < 10; i++) {
String s = reader.readLine();
if (s.isEmpty()) break;
input.add(Integer.parseInt(s));
}
srt_method(input);
}
}