public abstract int publish(TopicPath topic, List<OutgoingMessage> outgoingMessages)
      throws IOException;
@Test
  public void publishOneMessage() throws IOException {
    OutgoingMessage expectedOutgoingMessage =
        OutgoingMessage.of(
            PubsubMessage.newBuilder().setData(ByteString.copyFromUtf8(DATA)).build(),
            MESSAGE_TIME,
            MESSAGE_ID,
            null);
    try (PubsubTestClientFactory factory =
        PubsubTestClient.createFactoryForPublish(
            TOPIC, Sets.newHashSet(expectedOutgoingMessage), ImmutableList.of())) {
      try (PubsubTestClient client = (PubsubTestClient) factory.newClient(null, null, null)) {
        client.publish(TOPIC, ImmutableList.of(expectedOutgoingMessage));
      }
    }
  }