public static String decode(String s)
  {
    final int n = s.length();
    StringBuilder result = new StringBuilder(n);
    for (int i = 0; i < n; i++)
    {
      char c = s.charAt(i);
      if (c == '%')
      {
        int numCharsConsumed = decodeConsecutiveOctets(result, s, i);
        i += numCharsConsumed - 1;
      }
      else
      {
        result.append(c);
      }
    }
    return result.toString();
  }
@Test(dataProvider = "validEncodedText")
  public void testDecodeValidStrings(String encoded, String expected)
  {
    String actual = URIDecoderUtils.decode(encoded);

    Assert.assertEquals(actual, expected, "Encoded string was incorrectly decoded.");
  }