static PrintStream create(
      Handler handler, String loggerName, Level messageLevel, Charset charset) {
    try {
      return new JulHandlerPrintStream(handler, loggerName, messageLevel, charset);
    } catch (UnsupportedEncodingException exc) {
      throw new RuntimeException("Encoding not supported: " + charset.name(), exc);
    }
  }
@Test
  public void testLogRecordMetadata() {
    PrintStream printStream =
        JulHandlerPrintStreamAdapterFactory.create(
            handler, "fooLogger", Level.WARNING, StandardCharsets.UTF_8);
    printStream.println("anyMessage");

    assertThat(handler.getLogs(), not(empty()));
    LogRecord log = Iterables.get(handler.getLogs(), 0);

    assertThat(log.getLevel(), is(Level.WARNING));
    assertThat(log.getLoggerName(), is("fooLogger"));
  }