FileDialogOperation createFileDialogOperation( SelectionOperation selectionOperation ) {

    switch ( selectionOperation ) {
      case FILE:
        return new FileDialogOperation( FileDialogOperation.SELECT_FILE, FileDialogOperation.ORIGIN_SPOON );
      case FOLDER:
        return new FileDialogOperation( FileDialogOperation.SELECT_FOLDER, FileDialogOperation.ORIGIN_SPOON );
      case FILE_OR_FOLDER:
        return new FileDialogOperation( FileDialogOperation.SELECT_FILE_FOLDER, FileDialogOperation.ORIGIN_SPOON );
      case SAVE:
        return new FileDialogOperation( FileDialogOperation.SAVE, FileDialogOperation.ORIGIN_SPOON );
      case SAVE_TO:
        return new FileDialogOperation( FileDialogOperation.SAVE_TO, FileDialogOperation.ORIGIN_SPOON );
      case SAVE_TO_FILE_FOLDER:
        return new FileDialogOperation( FileDialogOperation.SAVE_TO_FILE_FOLDER, FileDialogOperation.ORIGIN_SPOON );
      case OPEN:
        return new FileDialogOperation( FileDialogOperation.OPEN, FileDialogOperation.ORIGIN_SPOON );
      default:
        throw new IllegalArgumentException( "Unexpected SelectionOperation: " + selectionOperation );
    }

  }
@Test
  public void testCreateFileDialogOperation() {
    // TEST : SELECT file
    FileDialogOperation fdo1 = testInstance.createFileDialogOperation( SelectionOperation.FILE );
    assertNotNull( fdo1 );
    assertEquals( FileDialogOperation.SELECT_FILE, fdo1.getCommand() );
    assertEquals( FileDialogOperation.ORIGIN_SPOON, fdo1.getOrigin() );

    // TEST : SELECT folder
    FileDialogOperation fdo2 = testInstance.createFileDialogOperation( SelectionOperation.FOLDER );
    assertNotNull( fdo2 );
    assertEquals( FileDialogOperation.SELECT_FOLDER, fdo2.getCommand() );
    assertEquals( FileDialogOperation.ORIGIN_SPOON, fdo2.getOrigin() );

    // TEST : SELECT folder
    FileDialogOperation fdo3 = testInstance.createFileDialogOperation( SelectionOperation.FILE_OR_FOLDER );
    assertNotNull( fdo3 );
    assertEquals( FileDialogOperation.SELECT_FILE_FOLDER, fdo3.getCommand() );
    assertEquals( FileDialogOperation.ORIGIN_SPOON, fdo3.getOrigin() );
  }