AfterProcessingTime extends OnceTrigger { @Override public String toString() { StringBuilder builder = new StringBuilder("AfterProcessingTime.pastFirstElementInPane()"); for (TimestampTransform transform : getTimestampTransforms()) { if (transform instanceof TimestampTransform.Delay) { TimestampTransform.Delay delay = (TimestampTransform.Delay) transform; builder .append(".plusDelayOf(") .append(DURATION_FORMATTER.print(delay.getDelay().toPeriod())) .append(")"); } else if (transform instanceof TimestampTransform.AlignTo) { TimestampTransform.AlignTo alignTo = (TimestampTransform.AlignTo) transform; builder .append(".alignedTo(") .append(DURATION_FORMATTER.print(alignTo.getPeriod().toPeriod())) .append(", ") .append(alignTo.getOffset()) .append(")"); } } return builder.toString(); } private  AfterProcessingTime(List<TimestampTransform> timestampTransforms); static AfterProcessingTime pastFirstElementInPane(); List<TimestampTransform> getTimestampTransforms(); AfterProcessingTime plusDelayOf(final Duration delay); AfterProcessingTime alignedTo(final Duration period, final Instant offset); AfterProcessingTime alignedTo(final Duration period); @Override boolean isCompatible(Trigger other); @Override Instant getWatermarkThatGuaranteesFiring(BoundedWindow window); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode();  }
@Test public void testToString() { Trigger trigger = AfterProcessingTime.pastFirstElementInPane(); assertEquals("AfterProcessingTime.pastFirstElementInPane()", trigger.toString()); }