### Question:
MenuData { public int getMnemonic() { return mnemonic; } MenuData(String[] menuPath);  MenuData(String[] menuPath, String group);  MenuData(String[] menuPath, Icon icon);  MenuData(String[] menuPath, Icon icon, String menuGroup);  MenuData(String[] menuPath, Icon icon, String menuGroup, int mnemonic,
			String menuSubGroup);  MenuData(MenuData menuData); MenuData cloneData(); String[] getMenuPath(); String getMenuPathAsString(); int getMnemonic(); Icon getMenuIcon(); String getMenuGroup(); String getMenuSubGroup(); String getParentMenuGroup(); void setIcon(Icon newIcon); void setMenuGroup(String newGroup); void setMenuSubGroup(String newSubGroup); void setParentMenuGroup(String newParentMenuGroup); void setMenuPath(String[] newPath); void setMnemonic(Character newMnemonic); void setMenuItemName(String newMenuItemName); String getMenuItemName(); static final int NO_MNEMONIC; static final String NO_SUBGROUP; }### Answer:
@Test public void testMenuDataParsesMnemonicFromAmpersand() { MenuData menuData = new MenuData(new String[] { "One", "Two", "&Three" }); assertEquals(menuData.getMnemonic(), 'T'); }
@Test public void testMenuDataPassedMnemonicWins() { MenuData menuData = new MenuData( new String[] { "One", "Two", "&Three" }, null, null, 'h', null); assertEquals(menuData.getMnemonic(), 'h'); }