private String compressRecursiveInner(String src, StringBuilder sb, int i, char previousChar,
      int charCounter) {
    boolean thereIsNoMoreWordToCompress = i == src.length();
    if (thereIsNoMoreWordToCompress) {
      addChar(sb, previousChar);
      addCharCounterIfNeeded(sb, charCounter);
      return sb.toString();
    } else {
      if (isCharRepeated(src.charAt(i), previousChar)) {
        return compressRecursiveInner(src, sb, i + 1, previousChar, charCounter + 1);
      } else {
        addChar(sb, previousChar);
        addCharCounterIfNeeded(sb, charCounter);
        return compressRecursiveInner(src, sb, i + 1, src.charAt(i), 1);
      }
    }
  }
Tail recursive solution to this problem. The complexity order in time and space terms of this
recursive version is the same than te previous one.
src/main/java/com/github/pedrovgs/problem53/CompressString.java