public static Write write() {
    return new AutoValue_RedisIO_Write.Builder()
        .setConnectionConfiguration(RedisConnectionConfiguration.create())
        .setMethod(Write.Method.APPEND)
        .build();
  }
@Test
  public void testWriteWithMethodPFAddWithExpireTime() {
    String key = "testWriteWithMethodPFAdd";
    List<String> values = Arrays.asList("0", "1", "2", "3", "2", "4", "0", "5");
    List<KV<String, String>> data = buildConstantKeyList(key, values);

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

    long count = client.pfcount(key);
    assertEquals(6, count);
    Long expireTime = client.pttl(key);
    assertTrue(expireTime.toString(), 9_000 <= expireTime && expireTime <= 10_0000);
    client.del(key);
  }