It seems that both are wrappers around the menu item... but I can't do something like

if (mi.gtkMenuItem is x.gtkMenuItem)

because gtkMenuItem(which is the same in both) is private making, unless there is another way, impossible to compare.

The way that works is here:

if (mi.getMenuItemStruct() is x.getMenuItemStruct())