@Test public void test1211() { String response = underTest.handleIteration("1211"); assertTrue("111221".equals(response)); }
protected String handleIteration(final String input) { String response = ""; boolean inSequence = false; char activeChar = ' '; int activeCharLength = 0; 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; }
InterceptorCore { protected String handleIteration(final String input) { String response = ""; boolean inSequence = false; char activeChar = ' '; int activeCharLength = 0; 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; } }
InterceptorCore { protected String handleIteration(final String input) { String response = ""; boolean inSequence = false; char activeChar = ' '; int activeCharLength = 0; 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; }  }
InterceptorCore { protected String handleIteration(final String input) { String response = ""; boolean inSequence = false; char activeChar = ' '; int activeCharLength = 0; 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; }   }
InterceptorCore { protected String handleIteration(final String input) { String response = ""; boolean inSequence = false; char activeChar = ' '; int activeCharLength = 0; 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; }    }