HandlerContainerImpl implements HandlerContainer { @Override public void bind() { if (!bound.value) { onBind(); bound.value = true; } } @Inject  HandlerContainerImpl();  HandlerContainerImpl(boolean autoBind); @Override void bind(); @Override final boolean isBound(); @Override void unbind();  }
@Test public void callingBindShouldInvokeOnBind( NonAutoboundHandlerContainer handlerContainer) { handlerContainer.bind(); assertEquals(1, handlerContainer.onBindMethodCalled); }