* @param returnTypeGenericMetadata The metadata to use to create the new mock.
* @param parentMock The parent of the current deep stub mock.
* @return The mock
*/
private Object newDeepStubMock(GenericMetadataSupport returnTypeGenericMetadata, Object parentMock) {
MockCreationSettings parentMockSettings = new MockUtil().getMockSettings(parentMock);
return mockitoCore().mock(
returnTypeGenericMetadata.rawType(),
withSettingsUsing(returnTypeGenericMetadata, parentMockSettings)
);
}