@Override
	public void visit(Entry entry) {
	    if(Boolean.FALSE.equals(entry.getAttribute("allowed")))
	        return;
		if (containsSubmenu(entry))
			addSubmenu(entry);
		else
			addActionItem(entry);
	}
@Test
	public void whenPopupMenuBecomesInvisible_popupListenerIsCalled() throws Exception {
		if(Compat.isMacOsX())
			return;
		Entry parentMenuEntry = new Entry();
		final JMenu parentMenu = new JMenu();
		new EntryAccessor().setComponent(parentMenuEntry, parentMenu);
		parentMenuEntry.addChild(menuEntry);
		menuEntry.addChild(actionEntry);

		menuActionGroupBuilder.visit(menuEntry);

		JMenu item = (JMenu)new EntryAccessor().getComponent(menuEntry);
		item.getPopupMenu().setVisible(true);
		item.getPopupMenu().setVisible(false);
		Thread.sleep(100);
		SwingUtilities.invokeAndWait(new Runnable() {
			@Override
			public void run() {
			}
		});

		verify(popupListener).childEntriesHidden(menuEntry);
	}