static Builder builder() {
    return new AutoValue_PubsubRowToMessage.Builder();
  }
@Test
  public void testSetTargetTimestampAttributeName() {
    Instant mockTimestamp = Instant.now();
    String mockTimestampString = mockTimestamp.toString();
    byte[] bytes = new byte[] {1, 2, 3, 4};

    Field payloadBytesField = Field.of(DEFAULT_PAYLOAD_KEY_NAME, FieldType.BYTES);

    Schema withPayloadBytesSchema = Schema.of(payloadBytesField);
    Row withPayloadBytes = Row.withSchema(withPayloadBytesSchema).attachValues(bytes);

    String customTargetTimestampAttributeName = "custom_timestamp_key";

    PubsubRowToMessage withoutSetTargetTimestampAttributeName =
        PubsubRowToMessage.builder().setMockInstant(mockTimestamp).build();
    PubsubRowToMessage withSetTargetTimestampAttributeName =
        PubsubRowToMessage.builder()
            .setMockInstant(mockTimestamp)
            .setTargetTimestampAttributeName(customTargetTimestampAttributeName)
            .build();

    PCollection<Row> input =
        pipeline.apply(Create.of(withPayloadBytes)).setRowSchema(Schema.of(payloadBytesField));

    PAssert.that(input.apply(withoutSetTargetTimestampAttributeName).get(OUTPUT))
        .containsInAnyOrder(
            new PubsubMessage(
                bytes, ImmutableMap.of(DEFAULT_EVENT_TIMESTAMP_KEY_NAME, mockTimestampString)));

    PAssert.that(input.apply(withSetTargetTimestampAttributeName).get(OUTPUT))
        .containsInAnyOrder(
            new PubsubMessage(
                bytes, ImmutableMap.of(customTargetTimestampAttributeName, mockTimestampString)));

    pipeline.run(PIPELINE_OPTIONS);
  }