### Question:
DiffPresentationFactoryImpl implements IDiffPresentationFactory { @Override public IDiffPresentation createDiffPresentation(SessionInfoProvider sessionInfoProvider, DBDiffPreferenceBean preferenceBean) { IDiffPresentation result = null; if (preferenceBean.isUseExternalGraphicalDiffTool()) { result = new ExternalToolSideBySideDiffPresentation(); } else { if (preferenceBean.isUseTabularDiffPresenation()) { result = new TabularDiffPresentation(); } else { result = new JMeldDiffPresentation(); } } result.setSessionInfoProvider(sessionInfoProvider); result.setPreferenceBean(preferenceBean); return result; }  @Override IDiffPresentation createDiffPresentation(SessionInfoProvider sessionInfoProvider,
		DBDiffPreferenceBean preferenceBean);  }### Answer:
@Test public void testCreateDiffPresentation() { when(mockPreferenceBean.isUseTabularDiffPresenation()).thenReturn(true); when(mockPreferenceBean.isUseExternalGraphicalDiffTool()).thenReturn(false); IDiffPresentation result = classUnderTest.createDiffPresentation(mockSessionInfoProvider, mockPreferenceBean); assertTrue(result instanceof TabularDiffPresentation); when(mockPreferenceBean.isUseTabularDiffPresenation()).thenReturn(false); when(mockPreferenceBean.isUseExternalGraphicalDiffTool()).thenReturn(true); result = classUnderTest.createDiffPresentation(mockSessionInfoProvider, mockPreferenceBean); assertTrue(result instanceof ExternalToolSideBySideDiffPresentation); when(mockPreferenceBean.isUseTabularDiffPresenation()).thenReturn(false); when(mockPreferenceBean.isUseExternalGraphicalDiffTool()).thenReturn(false); result = classUnderTest.createDiffPresentation(mockSessionInfoProvider, mockPreferenceBean); assertTrue(result instanceof JMeldDiffPresentation); }