public static boolean checkFile( FileObject fileObject ) throws KettleXMLException {
    try {
      return fileObject != null && fileObject.exists() && fileObject.isFile();
    } catch ( FileSystemException e ) {
      throw new KettleXMLException( BaseMessages.getString(
        PKG, "XMLHandler.errorCheckingFileExistence", fileObject.toString() ), e );
    }
  }
@Test( expected = KettleXMLException.class )
  public void checkFile_Exception() throws Exception {
    FileObject fileObjectMock = mock( FileObject.class );
    doReturn( true ).when( fileObjectMock ).exists();
    doThrow( new FileSystemException( DUMMY ) ).when( fileObjectMock ).isFile();

    XMLHandler.checkFile( fileObjectMock );
  }