public static Write write() {
    return new AutoValue_RedisIO_Write.Builder()
        .setConnectionConfiguration(RedisConnectionConfiguration.create())
        .setMethod(Write.Method.APPEND)
        .build();
  }
@Test
  public void testWriteWithMethodSetWithExpiration() {
    String key = "testWriteWithMethodSet";
    client.set(key, "value");

    String newValue = "newValue";
    PCollection<KV<String, String>> write = p.apply(Create.of(KV.of(key, newValue)));
    write.apply(
        RedisIO.write()
            .withEndpoint(REDIS_HOST, port)
            .withMethod(Method.SET)
            .withExpireTime(10_000L));
    p.run();

    assertEquals(newValue, client.get(key));
    Long expireTime = client.pttl(key);
    assertTrue(expireTime.toString(), 9_000 <= expireTime && expireTime <= 10_0000);
    client.del(key);
  }