void () { TextWithMnemonic hello = TextWithMnemonic.parse("hello(&H)..."); assertEquals("hello(_H)...", hello.toString()); assertText(hello, "hello...", "hello(H)..."); assertMnemonic(hello, 6, KeyEvent.VK_H, 'H'); TextWithMnemonic hello2 = TextWithMnemonic.parse("hello (&H)…"); assertEquals("hello (_H)…", hello2.toString()); assertText(hello2, "hello…", "hello (H)…"); assertMnemonic(hello2, 7, KeyEvent.VK_H, 'H'); TextWithMnemonic fromPlain = TextWithMnemonic.fromPlainText("hello...", 'x'); assertEquals("hello(_X)...", fromPlain.toString()); assertText(fromPlain, "hello...", "hello(X)..."); assertMnemonic(fromPlain, 6, KeyEvent.VK_X, 'X'); }