class OutputUtils {

  private static final int BYTES_PER_LINE = 16;
  private static final int HALF_BYTES_PER_LINE = BYTES_PER_LINE / 2;

  private OutputUtils() {
  }

  public static String arrayToString(byte[] bytes) {<FILL_FUNCTION_BODY>}

  private static char hexChar(int value) {
    return (char) (value < 10 ? ('0' + value) : ('a' + (value - 10)));
  }

}

    StringBuilder result = new StringBuilder(bytes.length * 4);
    int i = 0;
    while (i < bytes.length) {
      int value = bytes[i] & 0xFF;
      result.append(hexChar(value / 16));
      result.append(hexChar(value % 16));
      i++;
      if (i % BYTES_PER_LINE == 0) {
        result.append('\n');
      } else if (i % HALF_BYTES_PER_LINE == 0) {
        result.append("   ");
      } else {
        result.append(' ');
      }
    }
    return result.toString();
  
<no_super_class>