static void validate(
      final LogicalSchema schema,
      final GenericKey key,
      final GenericRow value
  ) {
    final int expectedKeyCount = schema.key().size();
    final int actualKeyCount = key.values().size();
    if (actualKeyCount != expectedKeyCount) {
      throw new IllegalArgumentException("key column count mismatch."
          + " expected: " + expectedKeyCount
          + ", got: " + actualKeyCount
      );
    }

    final int expectedValueCount = schema.value().size();
    final int actualValueCount = value.size();
    if (expectedValueCount != actualValueCount) {
      throw new IllegalArgumentException("value column count mismatch."
          + " expected: " + expectedValueCount
          + ", got: " + actualValueCount
      );
    }
  }
@Test(expected = IllegalArgumentException.class)
  public void shouldThrowOnValueFieldCountMismatch() {
    // Given:
    final GenericRow valueWithLessFields = GenericRow.genericRow("v0-v");

    // When:
    TableRowValidation.validate(SCHEMA, A_KEY, valueWithLessFields);
  }