@Override
    public List<Integer> loadArrayFromFile(String path) {

        if (path == null) {
            throw new IllegalArgumentException("Path is not specified!");
        }

        List<Integer> list = new ArrayList<Integer>();

        String line;

        BufferedReader bufferedReader = null;

        try {
            FileInputStream fileInputStream = new FileInputStream(path);

            // reading the primitive data from the input stream
            DataInputStream dataInputStream = new DataInputStream(fileInputStream);

            // read data efficiently as characters
            bufferedReader = new BufferedReader(new InputStreamReader(dataInputStream));

            // processing the lines in file
            while ((line = bufferedReader.readLine()) != null) {
                processLine(line, list);
            }
        } catch (IOException e) {
            throw new RuntimeException("File not found!");
        } finally {

            // closing bufferedReader
            try {
                if (bufferedReader != null) {
                    bufferedReader.close();
                }
            } catch (IOException ignored) {
            }
        }
        return list;
    }