@Test
public void testToContentDashboardItemTypeOptionalByDocument()
	throws PortalException {

	ContentDashboardItemType contentDashboardItemType =
		_getContentDashboardItemType();
	InfoItemReference infoItemReference =
		contentDashboardItemType.getInfoItemReference();
	Document document = Mockito.mock(Document.class);
	Mockito.when(
		document.get(Field.ENTRY_CLASS_NAME)
	).thenReturn(
		infoItemReference.getClassName()
	);
	Mockito.when(
		document.get(Field.ENTRY_CLASS_PK)
	).thenReturn(
		String.valueOf(infoItemReference.getClassPK())
	);
	ContentDashboardItemTypeFactory contentDashboardItemTypeFactory =
		_getContentDashboardItemTypeFactory(contentDashboardItemType);
	ContentDashboardItemTypeFactoryTracker
		contentDashboardItemTypeFactoryTracker =
			_getContentDashboardItemTypeFactoryTracker(
				contentDashboardItemType, contentDashboardItemTypeFactory);
	Optional<ContentDashboardItemType> contentDashboardItemTypeOptional =
		ContentDashboardItemTypeUtil.toContentDashboardItemTypeOptional(
			contentDashboardItemTypeFactoryTracker, document);
	Assert.assertEquals(
		contentDashboardItemType, contentDashboardItemTypeOptional.get());
}