### Question:
MockitoDoubleFactory implements DoubleFactory { @Override public Object createMock(DoubleDefinition mockDefinition) { return Mockito .mock( mockDefinition.getDoubleClass(), prepareMockSettings(mockDefinition)); } MockitoDoubleFactory();   MockitoDoubleFactory(Supplier<MockSettings> defaultSettingsProvider); @Override Object createMock(DoubleDefinition mockDefinition); @Override Object createSpy(@Nullable Object bean, DoubleDefinition spyDefinition);  }### Answer:
@Test public void should_create_mock_with_configuration() { final DoubleDefinition doubleDefinition = DoubleDefinition.builder() .name("mock") .doubleClass(Object.class) .doubleConfiguration(MockitoDoubleConfiguration.builder() .stubOnly(true) .verboseLogging(true) .serializableMode(SerializableMode.ACROSS_CLASSLOADERS) .answer(NoAnswer.class) .extraInterfaces(new Class[]{Closeable.class}) .invocationListeners(new Class[]{DoNothingInvocationListener.class}) .build()) .build(); doubleFactory.createMock(doubleDefinition); Mockito .verify(mockSettings) .stubOnly(); Mockito .verify(mockSettings) .verboseLogging(); Mockito .verify(mockSettings) .serializable(SerializableMode.ACROSS_CLASSLOADERS); Mockito .verify(mockSettings) .defaultAnswer(argThat(hasAnswerOfType(NoAnswer.class))); Mockito .verify(mockSettings) .extraInterfaces(argThat(new PresentInAnyOrder(AopInfrastructureBean.class, Closeable.class))); Mockito .verify(mockSettings) .invocationListeners(argThat(hasInstancesOf(DoNothingInvocationListener.class))); }