public static String asString(byte[] bytes, Charset charset) {
    if (charset == null) {
      charset = detectUtfCharset(bytes);
    }
    return skipBOM(new String(bytes, charset));
  }
@Test
  void validateTextConversionFromBytes() {
    assertEquals("A", UtfTextUtils.asString(hexBytes("EFBBBF41"), StandardCharsets.UTF_8));
    assertEquals("A", UtfTextUtils.asString(hexBytes("EFBBBF41"), null));

    assertEquals("A", UtfTextUtils.asString(hexBytes("41"), StandardCharsets.UTF_8));
    assertEquals("A", UtfTextUtils.asString(hexBytes("41"), null));
  }