The getIntegerList() method should read the number N from the keyboard and then return a list of N elements, which has been filled with numbers read from the keyboard. My program is reading method: int N = Integer.parseInt(bf.readLine()); and returns a list of N elements below: for (int i = 0; i<listaLiczbCalkowitych.get(0); i++) { listaLiczbCalkowitych.add(Integer.parseInt(bf.readLine()));} return listaLiczbCalkowitych; Where do I make mistake?