ForwardingBigQueryFileOutputFormat extends OutputFormat<K, V> { @SuppressWarnings("unchecked") protected synchronized FileOutputFormat<K, V> getDelegate(Configuration conf) throws IOException { if (delegate == null) { delegate = BigQueryOutputConfiguration.getFileOutputFormat(conf); logger.atInfo().log("Delegating functionality to '%s'.", delegate.getClass().getSimpleName()); } return delegate; }  @Override void checkOutputSpecs(JobContext job); @Override synchronized OutputCommitter getOutputCommitter(TaskAttemptContext context); @Override RecordWriter<K, V> getRecordWriter(TaskAttemptContext context);  }
@Test public void testGetDelegate() throws IOException { outputFormat.setDelegate(null); FileOutputFormat<Text, Text> delegate = outputFormat.getDelegate(conf); assertThat(delegate).isInstanceOf(TextOutputFormat.class); }