add mockito-like 'when' to the mixin