private static String compress(String input) {
		if (input == null || input.length() <= 2) {
			return input;
		}
		
		final StringBuffer output = new StringBuffer();
		char trackingChar = input.charAt(0);
		int charCount = 1;

		for (int index = 1; index < input.length(); ++index) {
			final char currentChar = input.charAt(index);
			
			if (trackingChar == currentChar) {
				++charCount;
				continue;
			}
			
			output.append(trackingChar);
			output.append(charCount);
			
			trackingChar = currentChar;
			charCount = 1;
		}
		
		output.append(trackingChar);
		output.append(charCount);
		
		return output.length() >= input.length() ? input : output.toString();
	}