void setStartDir( FileDialogOperation fileDialogOperation, FileObject fileObject, String filePath ) throws KettleException {
    try {
      fileDialogOperation.setStartDir( fileObject.isFolder() ? filePath : null );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setStartDir()", fse );
    }
  }
@Test
  public void testSetStartDir() throws Exception {
    // TEST : is file
    FileDialogOperation fileDialogOperation1 = createFileDialogOperation();
    FileObject fileObject1 = mock( FileObject.class );
    String absoluteFilePath = "/home/someuser/somedir";
    when( fileObject1.isFolder() ).thenReturn( false );

    testInstance.setStartDir( fileDialogOperation1, fileObject1, absoluteFilePath );

    assertNull( fileDialogOperation1.getStartDir() );

    // TEST : is not file
    FileDialogOperation fileDialogOperation2 = createFileDialogOperation();
    FileObject fileObject2 = mock( FileObject.class );
    when( fileObject2.isFolder() ).thenReturn( true );
    when( fileObject2.toString() ).thenReturn( absoluteFilePath );

    testInstance.setStartDir( fileDialogOperation2, fileObject2, absoluteFilePath );

    assertEquals( absoluteFilePath, fileDialogOperation2.getStartDir() );
  }