function checkSetComplement(
    predicate, sampleRowCount, expectedSalariesOriginal,
    expectedSalariesComplement) {
  var extractSalaries = function(relation) {
    return relation.entries.map(function(entry) {
      return entry.row.getSalary();
    });
  };

  var inputRelation = lf.proc.Relation.fromRows(
      getSampleRows(sampleRowCount), [e.getName()]);

  var assertOriginal = function() {
    var outputRelation = predicate.eval(inputRelation);
    assertArrayEquals(
        expectedSalariesOriginal,
        extractSalaries(outputRelation));
  };

  var assertComplement = function() {
    var outputRelation = predicate.eval(inputRelation);
    assertArrayEquals(
        expectedSalariesComplement,
        extractSalaries(outputRelation));
  };

  // Testing the original predicate.
  assertOriginal();

  // Testing the complement predicate.
  predicate.setComplement(true);
  assertComplement();

  // Testing going from the complement predicate back to the original.
  predicate.setComplement(false);
  assertOriginal();

  // Testing that calling setComplement() twice with the same value leaves the
  // predicate in a consistent state.
  predicate.setComplement(true);
  predicate.setComplement(true);
  assertComplement();
}
Performs a series of tests for the setComplement() method.
@param {!lf.Predicate} predicate The combined predicate to be tested.
@param {number} sampleRowCount The number of sample Employee rows to be used
    during testing.
@param {!Array<number>} expectedSalariesOriginal The expected salaries
    returned by the original predicate.
@param {!Array<number>} expectedSalariesComplement The expected salaries
    returned by the complement predicate.