@Test
public void testStopSpeakingAtBoundary() throws InterruptedException {

    NSSpeechSynthesizer ss = NSSpeechSynthesizer.synthesizerWithVoice(null);
    SynthesizerDelegate sd = new SynthesizerDelegate(ss);
    ss.setDelegate(sd);
    String toSpeak = "Hello are you receiving me now? I really hope someone is!";
    ss.startSpeakingString(toSpeak);
    Thread.sleep(50);
    ss.stopSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary.WordBoundary);
    sd.waitForSpeechDone(TIME_TO_WAIT, false);
    //don't want test case to be too timing dependent
    assertTrue("Expected less than 3 words but got: " + sd.getWordsSpoken(), sd.getWordsSpoken().size() < 3);
    assertTrue("Expected at least one word but got: " + sd.getWordsSpoken(), sd.getWordsSpoken().size() >= 1);
    //near as I can tell, SentenceBoundary just doesn't work!
    sd.reset();
    ss.startSpeakingString(toSpeak);
    sd.waitForNextWord(TIME_TO_WAIT);
    ss.stopSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary.SentenceBoundary);
    sd.waitForWord(TIME_TO_WAIT, "now");
    sd.waitForSpeechDone(TIME_TO_WAIT, false);
    assertTrue("Expected 6 word sentence but got: " + sd.getWordsSpoken(), sd.getWordsSpoken().size() == 6);        
    sd.reset();
    ss.startSpeakingString(toSpeak);
    sd.waitForWord(TIME_TO_WAIT, "are");
    ss.stopSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary.ImmediateBoundary);
    sd.waitForSpeechDone(TIME_TO_WAIT, false);
    assertTrue("Expected less than 3 words but got: " + sd.getWordsSpoken(), sd.getWordsSpoken().size() < 3);
    assertTrue("Expected at least one word but got: " + sd.getWordsSpoken(), sd.getWordsSpoken().size() >= 0);
}