### Question:
ManagedSession extends AbstractSession<AbstractCanvas, AbstractCanvasHandler> { @Override public void open() { if (null == shapeListener) { shapeListener = new DefaultCanvasShapeListener(canvasControls); elementListener = new DefaultCanvasElementListener(canvasHandlerControls); registerListeners(); enableControls(); } } @Inject  ManagedSession(final DefinitionUtils definitionUtils,
                          final SessionLoader sessionLoader,
                          final @Any ManagedInstance<AbstractCanvas> canvasInstances,
                          final @Any ManagedInstance<AbstractCanvasHandler> canvasHandlerInstances,
                          final @Any ManagedInstance<CanvasControl<AbstractCanvas>> canvasControlInstances,
                          final @Any ManagedInstance<CanvasControl<AbstractCanvasHandler>> canvasHandlerControlInstances); @SuppressWarnings("unchecked") ManagedSession registerCanvasControl(final Class<? extends CanvasControl> type); @SuppressWarnings("unchecked") ManagedSession registerCanvasControl(final Class<? extends CanvasControl> type,
                                                final Class<? extends Annotation> qualifier); @SuppressWarnings("unchecked") ManagedSession registerCanvasHandlerControl(final Class<? extends CanvasControl> type); @SuppressWarnings("unchecked") ManagedSession registerCanvasHandlerControl(final Class<? extends CanvasControl> type,
                                                       final Class<? extends Annotation> qualifier); ManagedSession isControlActive(final Predicate<Class<? extends CanvasControl>> predicate); ManagedSession onCanvasControlRegistered(final Consumer<CanvasControl<AbstractCanvas>> c); ManagedSession onCanvasControlDestroyed(final Consumer<CanvasControl<AbstractCanvas>> c); ManagedSession onCanvasHandlerControlRegistered(final Consumer<CanvasControl<AbstractCanvasHandler>> c); ManagedSession onCanvasHandlerControlDestroyed(final Consumer<CanvasControl<AbstractCanvasHandler>> c); @Override void init(final Metadata metadata,
                     final Command callback); @Override void open(); @Override void destroy(); @Override String getSessionUUID(); @Override AbstractCanvas getCanvas(); @Override AbstractCanvasHandler getCanvasHandler(); CanvasControl<AbstractCanvas> getCanvasControl(final Class<? extends CanvasControl> type); CanvasControl<AbstractCanvasHandler> getCanvasHandlerControl(final Class<? extends CanvasControl> type); static Annotation buildQualifier(final Class<? extends Annotation> type);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testOpen() { tested.registerCanvasControl(SomeTestControl.class) .registerCanvasHandlerControl(SomeTestControl.class) .init(metadata, mock(Command.class)); tested.open(); verify(canvas, times(1)).addRegistrationListener(any(CanvasShapeListener.class)); verify(canvasHandler, times(1)).addRegistrationListener(any(CanvasElementListener.class)); verify(canvasControl, times(1)).init(eq(canvas)); verify(canvasHandlerControl, times(1)).init(eq(canvasHandler)); }