class PerPlayerMenuItem extends AbstractMenuItem {

    @Override
    public MenuIcon getIcon(IconRequest iconRequest) {
        return iconRequestConsumer.apply(iconRequest);
    }

}

class PerPlayerMenuItemTest {

    @Mock
    private MenuSession menuSession;
    @Mock
    private Player player;
    @Mock
    private MenuIcon icon;
    @Spy Function<IconRequest, MenuIcon> iconRequestConsumer;
    @Spy Predicate<IconRequest> availableListener;
    private PerPlayerMenuItem menuItem;

    @Test
    public void getIcon() {

        IconRequest request = new IconRequest(player, menuSession);
        MenuIcon icon = menuItem.getIcon(request);
        assertEquals(this.icon, icon);
    }

}