public static ReplaceFirst replaceFirst(String regex, String replacement) {
    return replaceFirst(Pattern.compile(regex), replacement);
  }
@Test
  @Category(NeedsRunner.class)
  public void testReplaceFirst() {

    PCollection<String> output =
        p.apply(Create.of("xjx", "yjy", "zjz")).apply(Regex.replaceFirst("[xyz]", "new"));

    PAssert.that(output).containsInAnyOrder("newjx", "newjy", "newjz");
    p.run();
  }