public SchemaProvider getSchemaProvider() {
    if (batch.isPresent() && schemaProvider == null) {
      throw new HoodieException("Please provide a valid schema provider class!");
    }
    return Option.ofNullable(schemaProvider).orElseGet(NullSchemaProvider::getInstance);
  }
@Test
  public void getSchemaProviderShouldReturnGivenSchemaProvider() {
    SchemaProvider schemaProvider = new RowBasedSchemaProvider(null);
    final InputBatch<String> inputBatch = new InputBatch<>(Option.of("foo"), null, schemaProvider);
    assertSame(schemaProvider, inputBatch.getSchemaProvider());
  }