@Override
  public boolean equals(@Nullable Object other) {
    if (!(other instanceof PCollectionRowTuple)) {
      return false;
    }
    PCollectionRowTuple that = (PCollectionRowTuple) other;
    return this.pipeline.equals(that.pipeline) && this.pcollectionMap.equals(that.pcollectionMap);
  }
@Test
  public void testEquals() {
    TestPipeline p = TestPipeline.create();
    String intTag = "int";
    String strTag = "strs";

    PCollection<Row> ints =
        p.apply("ints", Create.of(toRows(Arrays.asList(3, -42, 77), INT_SCHEMA)));
    PCollection<Row> strs =
        p.apply("strs", Create.of(toRows(Arrays.asList("ab", "cd", "ef"), STRING_SCHEMA)));

    EqualsTester tester = new EqualsTester();
    // Empty tuples in the same pipeline are equal
    tester.addEqualityGroup(PCollectionRowTuple.empty(p), PCollectionRowTuple.empty(p));

    tester.addEqualityGroup(
        PCollectionRowTuple.of(intTag, ints).and(strTag, strs),
        PCollectionRowTuple.of(intTag, ints).and(strTag, strs));

    tester.addEqualityGroup(PCollectionRowTuple.of(intTag, ints));
    tester.addEqualityGroup(PCollectionRowTuple.of(strTag, strs));

    TestPipeline otherPipeline = TestPipeline.create();
    // Empty tuples in different pipelines are not equal
    tester.addEqualityGroup(PCollectionRowTuple.empty(otherPipeline));
    tester.testEquals();
  }