### Question:
MockitoDoubleConfigurationParser implements DoubleConfigurationParser<MockitoDoubleConfiguration, MockitoDouble> { @Override public MockitoDoubleConfiguration parseSpyConfiguration(String doubleName, MockitoDouble configuration) { final MockitoDoubleConfigurationBuilder configurationBuilder = MockitoDoubleConfiguration.builder(); configureDefaultAnswerForSpy(configurationBuilder); if (configuration != null) { configurationBuilder .answer(configuration.defaultAnswer()) .resetMode(configuration.resetMode()) .extraInterfaces(configuration.extraInterfaces()) .serializableMode(configuration.serializableMode()) .verboseLogging(configuration.verbose()) .stubOnly(configuration.stub()) .invocationListeners(configuration.invocationListeners()); } configurationBuilder.name(doubleName); return configurationBuilder.build(); }  @Override MockitoDoubleConfiguration parseMockConfiguration(String doubleName, MockitoDouble configuration); @Override MockitoDoubleConfiguration parseSpyConfiguration(String doubleName, MockitoDouble configuration);  }### Answer:
@Test public void should_set_default_answer_for_spy_beans() { final MockitoDoubleConfiguration configuration = configurationParser.parseSpyConfiguration(ANY_NAME, AnyTest.spy()); configuration.createMockSettings(mockSettings); Mockito .verify(mockSettings) .defaultAnswer(argThat(HasDefaultAnswer.hasAnswerOfType(CallsRealMethods.class))); }
@Test public void should_override_default_answer_for_spy_beans() { final MockitoDoubleConfiguration configuration = configurationParser.parseSpyConfiguration(ANY_NAME, AnyTest.withAnswer()); configuration.createMockSettings(mockSettings); final InOrder defaultAnswer = Mockito.inOrder(mockSettings); defaultAnswer .verify(mockSettings) .defaultAnswer(argThat(HasDefaultAnswer.hasAnswerOfType(CallsRealMethods.class))); defaultAnswer .verify(mockSettings) .defaultAnswer(argThat(HasDefaultAnswer.hasAnswerOfType(DoesNothing.class))); }
@Test public void should_generate_spy_name_from_provided_argument() { final String spyName = ANY_NAME; final MockitoDoubleConfiguration configuration = configurationParser.parseSpyConfiguration(spyName, AnyTest.spy()); configuration.createMockSettings(mockSettings); Mockito .verify(mockSettings) .name(spyName); }