@Override
    public List<Integer> sort(List<Integer> list) {

        // checking input parameter for null
        if (list == null) {
            throw new IllegalArgumentException("ArrayList not specified!");
        }

        // moving forward through array.
        for (int i = list.size() - 1; i >= 2; i--) {

            boolean sorted = true;

            // set the correct order between near elements.
            for (int j = 0; j < i; j++) {

                // swap places if the order of  elements are not correct and mark swap.
                if (list.get(j) > list.get(j + 1)) {
                    appUtil.swap(list, j, j + 1);
                    sorted = false;
                }
            }
            // stop if no changes was made.
            if (sorted) {
                break;
            }
        }
        return list;
    }