### Question:
InputDependencyConstraintChecker { public boolean check(final SchedulingExecutionVertex schedulingExecutionVertex) { final InputDependencyConstraint inputConstraint = schedulingExecutionVertex.getInputDependencyConstraint(); if (schedulingExecutionVertex.getConsumedResultPartitions().isEmpty() || ALL.equals(inputConstraint)) { return checkAll(schedulingExecutionVertex); } else if (ANY.equals(inputConstraint)) { return checkAny(schedulingExecutionVertex); } else { throw new IllegalArgumentException(); } }  boolean check(final SchedulingExecutionVertex schedulingExecutionVertex);  }### Answer:
@Test public void testCheckInputVertex() { final TestingSchedulingExecutionVertex vertex = addSchedulingExecutionVertex().finish(); final InputDependencyConstraintChecker inputChecker = createInputDependencyConstraintChecker(Collections.emptyList()); assertTrue(inputChecker.check(vertex)); }
@Test public void testCheckEmptyPipelinedInput() { final List<TestingSchedulingResultPartition> partitions = addResultPartition() .withPartitionType(PIPELINED) .withPartitionState(EMPTY) .finish(); final TestingSchedulingExecutionVertex vertex = addSchedulingExecutionVertex() .withConsumedPartitions(partitions) .finish(); final InputDependencyConstraintChecker inputChecker = createInputDependencyConstraintChecker(partitions); assertFalse(inputChecker.check(vertex)); }
@Test public void testCheckProducingPipelinedInput() { final List<TestingSchedulingResultPartition> partitions = addResultPartition() .withPartitionType(PIPELINED) .withPartitionState(PRODUCING) .finish(); final TestingSchedulingExecutionVertex vertex = addSchedulingExecutionVertex() .withConsumedPartitions(partitions) .finish(); final InputDependencyConstraintChecker inputChecker = createInputDependencyConstraintChecker(partitions); assertTrue(inputChecker.check(vertex)); }