@Test public void testFindFragmentByFactoryId() {

	// Arrange:
	final FragmentManager mockManager = mock(FragmentManager.class);
	final FragmentFactory mockFactory = mock(FragmentFactory.class);
	final Fragment mockFragment = mock(TestFragment.class);
	final FragmentController controller = new FragmentController(mockManager);
	controller.setFactory(mockFactory);
	when(mockFactory.isFragmentProvided(TestFactory.FRAGMENT_1)).thenReturn(true);
	when(mockFactory.createFragmentTag(TestFactory.FRAGMENT_1)).thenReturn("TAG.TestFragment");
	when(mockManager.findFragmentByTag("TAG.TestFragment")).thenReturn(mockFragment);
	// Act + Assert:
	assertThat(controller.findFragmentByFactoryId(TestFactory.FRAGMENT_1), is(mockFragment));
	verify(mockFactory).isFragmentProvided(TestFactory.FRAGMENT_1);
	verify(mockFactory).createFragmentTag(TestFactory.FRAGMENT_1);
	verify(mockManager).findFragmentByTag("TAG.TestFragment");
}