class InterceptorCore {

    protected String handleIteration(final String input) {
        String response = "";
        boolean inSequence = false;
        char activeChar = ' '; //not necessary, compiler does not recognize, that it is always assigned properly
        int activeCharLength = 0; //not necessary, compiler does not recognize, that it is always assigned properly
        for (int i = 0; i < input.length(); i++) {
            if (!inSequence) {
                activeChar = input.charAt(i);
                activeCharLength = 1;
                inSequence = true;
            } else {
                if (activeChar == input.charAt(i)) {
                    activeCharLength++;
                } else {
                    response = response + activeCharLength + activeChar;
                    activeChar = input.charAt(i);
                    activeCharLength = 1;
                }
            }
        }
        if (input.length() > 0) {
            response = response + activeCharLength + activeChar;
        }
        return response;
    }

}