@Test
public void testGetError() throws InterruptedException {

    NSSpeechSynthesizer ss = NSSpeechSynthesizer.synthesizerWithVoice(null);
    SynthesizerDelegate sd = new SynthesizerDelegate(ss);
    ss.startSpeakingString("Try this one [[pbas foobar]] two　three");
    sd.waitForWord(1000, "three");
    assertTrue("Should have error position", sd.position > 0);
    assertTrue("Should have error message", sd.errorMessage != null);
    NSSpeechSynthesizer.NSSpeechError error = ss.getError();
    assertTrue("Should find error", error.getErrorCount() > 0);
    assertTrue("Should have error position", error.getNewestCharacterOffset() > 0);
    assertTrue("Should have error code", error.getNewestCode() != 0);
    sd.waitForSpeechDone(5000, true);
}