@Test
@SuppressWarnings("unchecked")
public void addJars() {

    // Mock resource loader
    final DataSourceResourceLoader resourceLoader = Mockito.mock(DataSourceResourceLoader.class);
    Mockito.when(resourceLoader.addJars(Mockito.any(List.class))).thenReturn(true, false, true);
    // Test adding jars
    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));
}