static List<Integer> removeInSeq(List<Integer> list, final int repeat) {
        if (repeat < 1 || list == null) throw new IllegalArgumentException();

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

        List<Integer> buff = new ArrayList<>();
        for (Integer n : list) {
            if (buff.isEmpty() || Objects.equals(buff.get(0), n)) {
                buff.add(n);
            } else {
                if (buff.size() < repeat) {
                    result.addAll(buff);
                }
                buff.clear();
                buff.add(n);
            }
        }

        if (!buff.isEmpty() && buff.size() < repeat) {
            result.addAll(buff);
        }
        return result;
    }