Code review comment: The write tests also read from bigquery table for validation with pipelines, with exactly same pipelines of the read test. So I have consolidated these two read tests into writeandread.

Code under review:
public void readAndValidateRows(BigQueryIOJsonOptions options) {
    TypedRead<TableRow> bigqueryIO = BigQueryIO.readTableRows().withMethod(options.getReadMethod());

    
    if (!options.getInputQuery().isEmpty()) {
      bigqueryIO = bigqueryIO.fromQuery(options.getInputQuery()).usingStandardSql();
    } else {
      bigqueryIO = bigqueryIO.from(options.getInputTable());
    }

    PCollection<TableRow> jsonRows = p.apply("Read rows", bigqueryIO);

    if (!options.getInputQuery().isEmpty()) {
      PAssert.that(jsonRows).containsInAnyOrder(JSON_QUERY_TEST_DATA);
      p.run().waitUntilFinish();
      return;
    }

    final boolean unescape = options.getWriteMethod() == Write.Method.FILE_LOADS;

    
    PCollection<KV<String, String>> countries =
        jsonRows.apply(
            "Convert countries to KV JSON Strings", ParDo.of(new CountryToKVJsonString()));

    PAssert.that(countries).satisfies(new CompareJsonStrings(getTestData("countries"), unescape));

    
    PCollection<KV<String, String>> stats =
        jsonRows.apply("Convert stats to KV JSON Strings", ParDo.of(new StatsToKVJsonString()));

    PAssert.that(stats).satisfies(new CompareJsonStrings(getTestData("stats"), unescape));

    
    PCollection<KV<String, String>> cities =
        jsonRows.apply("Convert cities to KV JSON Strings", ParDo.of(new CitiesToKVJsonString()));

    PAssert.that(cities).satisfies(new CompareJsonStrings(getTestData("cities"), unescape));

    
    PCollection<KV<String, String>> landmarks =
        jsonRows.apply(
            "Convert landmarks to KV JSON Strings", ParDo.of(new LandmarksToKVJsonString()));

    PAssert.that(landmarks).satisfies(new CompareJsonStrings(getTestData("landmarks"), unescape));

    p.run().waitUntilFinish();
  }

Line commented on: jsonRows.apply(

Revised code:
public void readAndValidateRows(BigQueryIOJsonOptions options) {
    TypedRead<TableRow> bigqueryIO = BigQueryIO.readTableRows().withMethod(options.getReadMethod());

    
    if (!options.getInputQuery().isEmpty()) {
      bigqueryIO = bigqueryIO.fromQuery(options.getInputQuery()).usingStandardSql();
    } else {
      bigqueryIO = bigqueryIO.from(options.getInputTable());
    }

    PCollection<TableRow> jsonRows = p.apply("Read rows", bigqueryIO);

    if (!options.getInputQuery().isEmpty()) {
      PAssert.that(jsonRows).containsInAnyOrder(JSON_QUERY_TEST_DATA);
      p.run().waitUntilFinish();
      return;
    }

    final boolean unescape = options.getWriteMethod() == Write.Method.FILE_LOADS;

    
    PCollection<KV<String, String>> countries =
        jsonRows.apply(
            "Convert countries to KV JSON Strings", ParDo.of(new CountryToKVJsonString()));

    PAssert.that(countries).satisfies(new CompareJsonStrings(getTestData("countries"), unescape));

    
    PCollection<KV<String, String>> stats =
        jsonRows.apply("Convert stats to KV JSON Strings", ParDo.of(new StatsToKVJsonString()));

    PAssert.that(stats).satisfies(new CompareJsonStrings(getTestData("stats"), unescape));

    
    PCollection<KV<String, String>> cities =
        jsonRows.apply("Convert cities to KV JSON Strings", ParDo.of(new CitiesToKVJsonString()));

    PAssert.that(cities).satisfies(new CompareJsonStrings(getTestData("cities"), unescape));

    
    PCollection<KV<String, String>> landmarks =
        jsonRows.apply(
            "Convert landmarks to KV JSON Strings", ParDo.of(new LandmarksToKVJsonString()));

    PAssert.that(landmarks).satisfies(new CompareJsonStrings(getTestData("landmarks"), unescape));

    p.run().waitUntilFinish();
  }