@Test
public void testLegendEntryRegressionMenu() {
Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
.thenReturn(new ExecutionResult(null, false, null));
LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
JMenuItem regressionLineCheckbox = ((JMenuItem) manager.getPopup(mockLegendEntry).getComponent(PREDICTION_CHECKBOX));
Assert.assertEquals(regressionLineCheckbox.getText(), BUNDLE.getString("RegressionLineLabel"));
Assert.assertFalse(regressionLineCheckbox.isSelected());
JMenu regressionPointsMenu = ((JMenu) manager.getPopup(mockLegendEntry).getComponent(PREDICTION_SUBMENU));
Assert.assertEquals(regressionPointsMenu.getText(), BUNDLE.getString("RegressionPointsLabel"));
JSpinner regressionPointsSpinner = (JSpinner) regressionPointsMenu.getMenuComponent(0);
Assert.assertEquals(regressionPointsSpinner.getModel().getValue(), mockLegendEntry.getNumberRegressionPoints());
}