@Override
  void validateKeyPresent(final SourceName sinkName, final Projection projection) {
    if (!PartitionByParamsFactory.isPartitionByNull(partitionBys)
        && !containsExpressions(projection, partitionBys)) {
      throwKeysNotIncludedError(sinkName, "partitioning expression", originalPartitionBys);
    }
  }
@Test
  public void shouldNotThrowIfProjectionHasPartitionBy() {
    // Given:
    when(projection.containsExpression(rewrittenPartitionBy)).thenReturn(true);

    // When:
    repartitionNode.validateKeyPresent(SOURCE_NAME, projection);

    // Then: did not throw.
  }