@Test public void shouldCompressWordsRecursive() { String wordToCompress = "aabcccccaaa"; String result = compressString.compressRecursive(wordToCompress); assertEquals("a2bc5a3", result); }
public String compressRecursive(String src) { validateInput(src); if (src.length() <= 1) { return src; } return compressRecursiveInner(src, new StringBuilder(), 1, src.charAt(0), 1); }
CompressString { public String compressRecursive(String src) { validateInput(src); if (src.length() <= 1) { return src; } return compressRecursiveInner(src, new StringBuilder(), 1, src.charAt(0), 1); } }
CompressString { public String compressRecursive(String src) { validateInput(src); if (src.length() <= 1) { return src; } return compressRecursiveInner(src, new StringBuilder(), 1, src.charAt(0), 1); }  }
CompressString { public String compressRecursive(String src) { validateInput(src); if (src.length() <= 1) { return src; } return compressRecursiveInner(src, new StringBuilder(), 1, src.charAt(0), 1); }  String compress(String src); String compressRecursive(String src); }
CompressString { public String compressRecursive(String src) { validateInput(src); if (src.length() <= 1) { return src; } return compressRecursiveInner(src, new StringBuilder(), 1, src.charAt(0), 1); }  String compress(String src); String compressRecursive(String src);  }