protected void setFilter( FileDialogOperation fileDialogOperation, String[] filters ) {
    String[] cleanedFilters = cleanFilters( filters );
    String filterString = ArrayUtils.isEmpty( cleanedFilters )
        ? FilterType.ALL.toString() // least restrictive option
        : String.join( ",", cleanedFilters );

    fileDialogOperation.setFilter( filterString );
  }
@Test
  public void testSetFilter() {

    // TEST : null filter
    FileDialogOperation fileDialogOperation1 = createFileDialogOperation();
    testInstance.setFilter( fileDialogOperation1, null );

    assertEquals( FilterType.ALL.toString(), fileDialogOperation1.getFilter() );

    // TEST: empty array filter
    FileDialogOperation fileDialogOperation2 = createFileDialogOperation();
    testInstance.setFilter( fileDialogOperation2, new String[]{} );

    assertEquals( FilterType.ALL.toString(), fileDialogOperation2.getFilter() );

    // TEST : one item filter
    FileDialogOperation fileDialogOperation3 = createFileDialogOperation();
    testInstance.setFilter( fileDialogOperation3, new String[]{ FilterType.TXT.toString() } );

    assertEquals( FilterType.TXT.toString(), fileDialogOperation3.getFilter() );

    // TEST : multiple filters
    FileDialogOperation fileDialogOperation4 = createFileDialogOperation();
    testInstance.setFilter( fileDialogOperation4, new String[]{ FilterType.TXT.toString(), FilterType.CSV.toString(), FilterType.JSON.toString() } );

    assertEquals( "TXT,CSV,JSON", fileDialogOperation4.getFilter() );
  }