function checkEvalRelations_TwoOuterJoins(evalFn) {
  var sampleRows = getSampleRows();
  var numJobsDeleted = 1;
  var numDepartmentsDeleted = 2;
  // Remove the last job row.
  var lessJobs = sampleRows.jobs.slice(
      0, sampleRows.jobs.length - numJobsDeleted);
  // Remove the last 2 rows in Departments.
  var lessDepartments = sampleRows.departments.slice(
      0, sampleRows.departments.length - numDepartmentsDeleted);

  var employeeRelation = lf.proc.Relation.fromRows(
      sampleRows.employees, [e.getName()]);
  var jobRelation = lf.proc.Relation.fromRows(
      lessJobs, [j.getName()]);
  var departmentRelation = lf.proc.Relation.fromRows(
      lessDepartments, [d.getName()]);

  var joinPredicate1 = e.jobId.eq(j.id);
  var joinPredicate2 = e.departmentId.eq(d.id);

  var numEmployeesPerJob = 10;
  var numEmployeesPerDepartment = 20;
  var expectedResults = sampleRows.employees.length - (numJobsDeleted *
      numEmployeesPerJob);
  var expectedResults2 = sampleRows.employees.length - (
      numDepartmentsDeleted * numEmployeesPerDepartment);

  // Tests inner join followed by outer join.
  var result = evalFn.call(
      joinPredicate1, employeeRelation, jobRelation, false);
  assertEquals(expectedResults, result.entries.length);
  var result2 = evalFn.call(joinPredicate2, result, departmentRelation, true);
  // Join employee and job with department.
  assertEquals(expectedResults, result2.entries.length);
  // joinPredicate1 is reversed in previous join.
  joinPredicate1 = e.jobId.eq(j.id);
  // Tests outer join followed by inner join.
  result = evalFn.call(joinPredicate1, employeeRelation, jobRelation, true);
  assertEquals(sampleRows.employees.length, result.entries.length);
  result2 = evalFn.call(joinPredicate2, result, departmentRelation, false);
  // Join employee and job with department
  assertEquals(expectedResults2, result2.entries.length);
  // joinPredicate2 is reversed in previous join.
  joinPredicate2 = e.departmentId.eq(d.id);
  // Tests outer join followed by outer join.
  result = evalFn.call(joinPredicate1, employeeRelation, jobRelation, true);
  assertEquals(sampleRows.employees.length, result.entries.length);
  result2 = evalFn.call(joinPredicate2, result, departmentRelation, true);
  assertEquals(sampleRows.employees.length, result2.entries.length);
}
Checks that the given outer join implementation is correct for two
Outer joins, for the case where the join predicate refers to unique keys.
@param {!function(!lf.proc.Relation, !lf.proc.Relation, boolean)
    :!lf.proc.Relation} evalFn The join implementation method should be
    either evalRelationsNestedLoopJoin_ or evalRelationsHashJoin_.