StorageFileHelper { public List<StorageFile> createStorageFilesFromEntities(Collection<StorageFileEntity> storageFileEntities, String storageUnitDirectoryPath) { List<StorageFile> storageFiles = new ArrayList<>(); for (StorageFileEntity storageFileEntity : storageFileEntities) { storageFiles.add(createStorageFileFromEntity(storageFileEntity, storageUnitDirectoryPath)); } return storageFiles; }  List<StorageFile> createStorageFilesFromEntities(Collection<StorageFileEntity> storageFileEntities, String storageUnitDirectoryPath); List<StorageFile> createStorageFilesFromEntities(Collection<StorageFileEntity> storageFileEntities); List<StorageFile> createStorageFilesFromS3ObjectSummaries(List<S3ObjectSummary> s3ObjectSummaries); List<StorageFile> getAndValidateStorageFiles(StorageUnitEntity storageUnitEntity, String s3KeyPrefix, String storageName,
        BusinessObjectDataKey businessObjectDataKey); List<StorageFile> getAndValidateStorageFilesIfPresent(StorageUnitEntity storageUnitEntity, String s3KeyPrefix, String storageName,
        BusinessObjectDataKey businessObjectDataKey); List<String> getFilePathsFromS3ObjectSummaries(List<S3ObjectSummary> s3ObjectSummaries); List<String> getFilePathsFromStorageFiles(List<StorageFile> storageFiles); List<File> getFiles(List<StorageFile> storageFiles); Map<String, StorageFileEntity> getStorageFileEntitiesMap(Collection<StorageFileEntity> storageFileEntities); Map<String, StorageFile> getStorageFilesMapFromS3ObjectSummaries(List<S3ObjectSummary> s3ObjectSummaries); void validateCreateRequestStorageFiles(List<StorageFile> storageFiles); void validateDownloadedS3Files(String baseDirectory, String s3KeyPrefix, StorageUnit storageUnit); void validateDownloadedS3Files(String baseDirectory, String s3KeyPrefix, List<StorageFile> storageFiles); void validateRegisteredS3Files(List<StorageFile> expectedStorageFiles, List<S3ObjectSummary> s3ObjectSummaries, String storageName,
        BusinessObjectDataKey businessObjectDataKey); void validateStorageFile(StorageFile storageFile, String s3BucketName, Map<String, StorageFile> actualS3Keys, boolean validateFileSize); void validateStorageFileEntity(StorageFileEntity storageFileEntity, String s3BucketName, Map<String, StorageFile> actualS3Keys,
        boolean validateFileSize); void validateStorageFilePaths(Collection<String> storageFilePaths, String s3KeyPrefix, BusinessObjectDataKey businessObjectDataKey,
        String storageName); void validateStorageUnitS3Files(StorageUnit storageUnit, List<String> actualS3Files, String s3KeyPrefix);  }
@Test public void testCreateStorageFileFromEntities() { StorageFileEntity storageFileEntity1 = new StorageFileEntity(); storageFileEntity1.setStorageUnit(null); storageFileEntity1.setPath(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "1"); storageFileEntity1.setFileSizeBytes(FILE_SIZE); storageFileEntity1.setRowCount(ROW_COUNT); StorageFileEntity storageFileEntity2 = new StorageFileEntity(); storageFileEntity2.setStorageUnit(null); storageFileEntity2.setPath(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "2"); storageFileEntity2.setFileSizeBytes(FILE_SIZE); storageFileEntity2.setRowCount(ROW_COUNT); List<StorageFile> storageFiles = null; storageFiles = storageFileHelper.createStorageFilesFromEntities(Arrays.asList(storageFileEntity1, storageFileEntity2)); assertEquals(new StorageFile(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "1", FILE_SIZE, ROW_COUNT), storageFiles.get(0)); assertEquals(new StorageFile(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "2", FILE_SIZE, ROW_COUNT), storageFiles.get(1)); storageFiles = storageFileHelper.createStorageFilesFromEntities(Arrays.asList(storageFileEntity1, storageFileEntity2), null); assertEquals(new StorageFile(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "1", FILE_SIZE, ROW_COUNT), storageFiles.get(0)); assertEquals(new StorageFile(STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "2", FILE_SIZE, ROW_COUNT), storageFiles.get(1)); storageFiles = storageFileHelper.createStorageFilesFromEntities(Arrays.asList(storageFileEntity1, storageFileEntity2), STRING_VALUE); assertEquals(new StorageFile(STRING_VALUE + "/" + STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "1", FILE_SIZE, ROW_COUNT), storageFiles.get(0)); assertEquals(new StorageFile(STRING_VALUE + "/" + STORAGE_DIRECTORY_PATH + "/" + FILE_NAME + "2", FILE_SIZE, ROW_COUNT), storageFiles.get(1)); }