// Load list of Integers, from console List<Integer> list = Arrays.stream(scanner.nextLine().split("s+")) .map(Integer::parseInt).collect(Collectors.toList());