public static <EventT> Write<EventT> write() {
    return new AutoValue_JmsIO_Write.Builder<EventT>().build();
  }
@Test
  public void testWriteMessageToStaticTopicWithoutRetryPolicy() throws Exception {
    Instant now = Instant.now();
    String messageText = now.toString();
    List<String> data = Collections.singletonList(messageText);

    Connection connection = connectionFactory.createConnection(USERNAME, PASSWORD);
    connection.start();
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer consumer = session.createConsumer(session.createTopic(TOPIC));

    WriteJmsResult<String> output =
        pipeline
            .apply(Create.of(data))
            .apply(
                JmsIO.<String>write()
                    .withConnectionFactory(connectionFactory)
                    .withValueMapper(new TextMessageMapper())
                    .withTopic(TOPIC)
                    .withUsername(USERNAME)
                    .withPassword(PASSWORD));
    PAssert.that(output.getFailedMessages()).empty();
    pipeline.run();
    Message message = consumer.receive(1000);
    assertNotNull(message);
    assertNull(consumer.receiveNoWait());
  }