### Question:
SparkDataSetContext extends DataSetOptions { public boolean isFileFormat() { if (fileFormat == null) { fileFormat = resolveFileFormat(); } return fileFormat; } SparkDataSetContext(@Nonnull final DataSetOptions parent, @Nonnull final KyloCatalogClient<T> client, @Nonnull final SparkDataSetDelegate<T> delegate); boolean isFileFormat(); @Nonnull @Override Option<String> getOption(@Nonnull final String key); @Nonnull @Override Map<String, String> getOptions(); @Nullable @Override List<String> getPaths();  }### Answer:
@Test @SuppressWarnings("unchecked") public void isFileFormat() { final SparkDataSetDelegate<DataFrame> delegate = Mockito.mock(SparkDataSetDelegate.class); Mockito.when(delegate.isFileFormat(Mockito.any(Class.class))).then(new Answer<Boolean>() { @Nonnull @Override public Boolean answer(@Nonnull final InvocationOnMock invocation) { final Class<?> clazz = invocation.getArgumentAt(0, Class.class); return HadoopFsRelationProvider.class.isAssignableFrom(clazz); } }); final DataSetOptions options = new DataSetOptions(); options.setFormat("invalid"); final KyloCatalogClient<DataFrame> client = Mockito.mock(KyloCatalogClient.class); SparkDataSetContext<DataFrame> context = new SparkDataSetContext<>(options, client, delegate); Assert.assertFalse("Expected 'invalid' to not be a file format", context.isFileFormat()); options.setFormat("jdbc"); context = new SparkDataSetContext<>(options, client, delegate); Assert.assertFalse("Expected 'jdbc' to not be a file format", context.isFileFormat()); options.setFormat("text"); context = new SparkDataSetContext<>(options, client, delegate); Assert.assertTrue("Expected 'text' to be a file format", context.isFileFormat()); options.setFormat("org.apache.spark.sql.execution.datasources.text.DefaultSource"); context = new SparkDataSetContext<>(options, client, delegate); Assert.assertTrue("Expected 'org.apache.spark.sql.execution.datasources.text.DefaultSource' to be a file format", context.isFileFormat()); options.setFormat("org.apache.spark.sql.execution.datasources.text"); context = new SparkDataSetContext<>(options, client, delegate); Assert.assertTrue("Expected 'org.apache.spark.sql.execution.datasources.text' to be a file format", context.isFileFormat()); }