@@ -0,0 +1,2307 @@
+package org.lodder.subtools.multisubdownloader.lib.control.subtitles;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.lodder.subtools.multisubdownloader.settings.model.Settings;%0Aimport org.lodder.subtools.sublibrary.model.Release;%0Aimport org.lodder.subtools.sublibrary.model.Subtitle;%0A%0Apublic class FilteringTest %7B%0A%0A  protected Filtering filtering;%0A  %0A  @Before%0A  public void setUp() throws Exception %7B%0A    filtering = null;%0A  %7D%0A  %0A  @Test%0A  public void testFiltering() %7B%0A    //test exlude hearing impaired%0A    Settings settings = createSettings(false, false, true);%0A    %0A    filtering = new Filtering(settings);%0A    %0A    Release release = createRelease(%22Criminal.Minds.S10E12.720p.HDTV.X264-DIMENSION.mkv%22);%0A    List%3CSubtitle%3E listFoundSubtitles = new ArrayList%3CSubtitle%3E();%0A    listFoundSubtitles.add(createSubtitle(%22%22,%22%22,%22%22,true));%0A    listFoundSubtitles.add(createSubtitle(%22%22,%22%22,%22%22,false));%0A    listFoundSubtitles.add(createSubtitle(%22%22,%22%22,%22%22,true));%0A    %0A    List%3CSubtitle%3E filtered = filtering.getFiltered(listFoundSubtitles, release);%0A    %0A    assertEquals(filtered.size(), 1);%0A    %0A  %7D%0A%0A  %0A  private Settings createSettings(boolean keyword, boolean exact, boolean excludehearing)%7B%0A    Settings settings = mock(Settings.class);%0A    %0A    when(settings.isOptionSubtitleExactMatch()).thenReturn(exact);%0A    when(settings.isOptionSubtitleKeywordMatch()).thenReturn(keyword);%0A    when(settings.isOptionSubtitleExcludeHearingImpaired()).thenReturn(excludehearing);%0A    %0A    return settings;%0A  %7D%0A  %0A  private Release createRelease(String filename)%7B%0A    Release release = mock(Release.class);%0A    %0A    when(release.getFilename()).thenReturn(filename);%0A    %0A    return release;%0A  %7D%0A  %0A  private Subtitle createSubtitle(String filename, String quality, String releasegroup, boolean excludehearing)%7B%0A    Subtitle subtitle = mock(Subtitle.class);%0A    %0A    when(subtitle.getFilename()).thenReturn(filename);%0A    when(subtitle.getQuality()).thenReturn(quality);%0A    when(subtitle.getReleasegroup()).thenReturn(releasegroup);%0A    when(subtitle.isHearingImpaired()).thenReturn(excludehearing);%0A    %0A    return subtitle;%0A  %7D%0A%0A%7D%0A

Create unit test for filtering, added first test exclude impaired hearing