@Test
public void testSetOutputToFileURL() throws IOException {

    File helloWorld = null;
    FileInputStream fis = null;
    try {
        helloWorld = File.createTempFile("helloworld", ".aiff");
        helloWorld.deleteOnExit();
        NSSpeechSynthesizer ss = NSSpeechSynthesizer.synthesizerWithVoice(null);
        SynthesizerDelegate sd = new SynthesizerDelegate(ss);
        ss.setOutputToFileURL(helloWorld.toURI());
        ss.startSpeakingString("Hello World");
        sd.waitForSpeechDone(5000, true);
        assertTrue(helloWorld.exists());
        fis = new FileInputStream(helloWorld);
        assertTrue("Should have some bytes", fis.available() > 0);
    } finally {
        if ( fis != null ) {
            fis.close();
        }
        if ( helloWorld != null ) {
            helloWorld.delete();
        }
    }
}