public static JComponent createSampleGraphJComponent() throws Exception
{
FunctionByEventsourceGraph<BigDecimal, BigDecimal> function = createGraphFunction();
function.addChangeListener(new SleepingListener(2000));
JComponent result = FunctionGraphUtils.asGraph(function, 770, 770, new InvocationContext());
MethodExecutingRunnable.startMethodExecution(function, "get", new BigDecimal(2));//start the method after the listeners are registered.
return result;
}