### Question:
AbstractDataSetOptionsAccess extends AbstractKyloCatalogDataSetAccess<R> { @Nonnull @Override public final R addJars(@Nullable final List<String> paths) { if (paths != null && resourceLoader.addJars(paths)) { options.addJars(paths); } 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 @SuppressWarnings("unchecked") public void addJars() { final DataSourceResourceLoader resourceLoader = Mockito.mock(DataSourceResourceLoader.class); Mockito.when(resourceLoader.addJars(Mockito.any(List.class))).thenReturn(true, false, true); final MockDataSetOptionsAccess mock = new MockDataSetOptionsAccess(resourceLoader); mock.addJars(Arrays.asList("file1.jar", "file2.jar")); mock.addJars(Collections.singletonList("file2.jar")); mock.addJars(Arrays.asList("file1.jar", "file3.jar")); Assert.assertEquals(4, mock.getOptions().getJars().size()); Assert.assertEquals("file1.jar", mock.getOptions().getJars().get(0)); Assert.assertEquals("file2.jar", mock.getOptions().getJars().get(1)); Assert.assertEquals("file1.jar", mock.getOptions().getJars().get(2)); Assert.assertEquals("file3.jar", mock.getOptions().getJars().get(3)); }