AttachmentUtil { public static Map<Locale, String> getTitleMap( CPAttachmentFileEntry cpAttachmentFileEntry, Map<String, String> titleMap) throws PortalException { if (titleMap != null) { return LanguageUtils.getLocalizedMap(titleMap); } if (cpAttachmentFileEntry == null) { return null; } return cpAttachmentFileEntry.getTitleMap(); }  static FileEntry addFileEntry(
			Attachment attachment, long groupId, long userId,
			UniqueFileNameProvider uniqueFileNameProvider); static FileEntry addFileEntry(
			AttachmentUrl attachmentUrl, long groupId, long userId,
			UniqueFileNameProvider uniqueFileNameProvider); static FileEntry addFileEntry(
			String base64EncodedContent, long groupId, long userId,
			UniqueFileNameProvider uniqueFileNameProvider); static Map<Locale, String> getTitleMap(
			CPAttachmentFileEntry cpAttachmentFileEntry,
			Map<String, String> titleMap); static CPAttachmentFileEntry upsertCPAttachmentFileEntry(
			CPAttachmentFileEntryService cpAttachmentFileEntryService,
			UniqueFileNameProvider uniqueFileNameProvider,
			AttachmentBase64 attachmentBase64, long classNameId, long classPK,
			int type, ServiceContext serviceContext); static CPAttachmentFileEntry upsertCPAttachmentFileEntry(
			CPAttachmentFileEntryService cpAttachmentFileEntryService,
			UniqueFileNameProvider uniqueFileNameProvider,
			AttachmentUrl attachmentUrl, long classNameId, long classPK,
			int type, ServiceContext serviceContext); static CPAttachmentFileEntry upsertCPAttachmentFileEntry(
			long groupId,
			CPAttachmentFileEntryService cpAttachmentFileEntryService,
			UniqueFileNameProvider uniqueFileNameProvider,
			Attachment attachment, long classNameId, long classPK, int type,
			ServiceContext serviceContext);  }
@Test public void testGetTitleMapIfCPAttachmentFileEntryIsNull() throws Exception { Map<Locale, String> titleMap = AttachmentUtil.getTitleMap( null, _titleMap); Assert.assertEquals( "Title map size", _titleMap.size(), titleMap.size()); titleMap.forEach( (key, value) -> Assert.assertTrue( "title map contains " + key.toString(), _titleMap.containsKey(key.toString()))); }