private static void pctEncode(byte data, ByteArrayOutputStream bos) {
    bos.write('%');
    char hex1 = Character.toUpperCase(Character.forDigit((data >> 4) & 0xF, 16));
    char hex2 = Character.toUpperCase(Character.forDigit(data & 0xF, 16));
    bos.write(hex1);
    bos.write(hex2);
  }
@Test
  void pctEncode() {
    String queryParameterValue = "firstName=James;lastName=Bond;location=England&Britain?";
    assertThat(UriUtils.encode(queryParameterValue, UTF_8))
        .isEqualToIgnoringCase(
            "firstName%3DJames%3BlastName%3DBond%3Blocation%3DEngland%26Britain%3F");
  }