### Question:
AbstractDataSetOptionsAccess extends AbstractKyloCatalogDataSetAccess<R> { @Nonnull @Override public final R addJar(@Nullable final String path) { if (path != null && resourceLoader.addJar(path)) { options.addJar(path); } return (R) this; } AbstractDataSetOptionsAccess(@Nonnull final DataSetOptions options, @Nonnull final Configuration hadoopConfiguration, @Nonnull final DataSourceResourceLoader resourceLoader); @Nonnull @Override final R addFile(@Nullable final String path); @Nonnull @Override final R addJar(@Nullable final String path); @Nonnull @Override final R addJars(@Nullable final List<String> paths); @Nonnull R dataSet(@Nonnull final DataSetTemplate dataSet); @Nonnull @Override final R format(@Nonnull final String source); @Nonnull @Override R option(@Nonnull final String key, @Nullable final String value);  }### Answer:
@Test public void addJar() { final DataSourceResourceLoader resourceLoader = Mockito.mock(DataSourceResourceLoader.class); Mockito.when(resourceLoader.addJar(Mockito.anyString())).thenReturn(false, true); final MockDataSetOptionsAccess mock = new MockDataSetOptionsAccess(resourceLoader); mock.addJar("file1.jar"); mock.addJar("file2.jar"); Assert.assertEquals(1, mock.getOptions().getJars().size()); Assert.assertEquals("file2.jar", mock.getOptions().getJars().get(0)); }