S3StorageProvider extends StorageProviderBase { protected String getSpaceCount(String spaceId, int maxCount) { List<String> spaceContentChunk = null; long count = 0; do { String marker = null; if (spaceContentChunk != null && spaceContentChunk.size() > 0) { marker = spaceContentChunk.get(spaceContentChunk.size() - 1); } spaceContentChunk = getSpaceContentsChunked(spaceId, null, MAX_ITEM_COUNT, marker); count += spaceContentChunk.size(); } while (spaceContentChunk.size() > 0 && count < maxCount); String suffix = ""; if (count >= maxCount) { suffix = "+"; } return String.valueOf(count) + suffix; } S3StorageProvider(String accessKey, String secretKey);  S3StorageProvider(String accessKey,
                             String secretKey,
                             Map<String, String> options);  S3StorageProvider(AmazonS3 s3Client,
                             String accessKey,
                             Map<String, String> options); @Override StorageProviderType getStorageProviderType(); Iterator<String> getSpaces(); Iterator<String> getSpaceContents(String spaceId,
                                             String prefix); List<String> getSpaceContentsChunked(String spaceId,
                                                String prefix,
                                                long maxResults,
                                                String marker); void createSpace(String spaceId); String createHiddenSpace(String spaceId, int expirationInDays); void setSpaceLifecycle(String bucketName,
                                  BucketLifecycleConfiguration config); void removeSpace(String spaceId); String addHiddenContent(String spaceId,
                                   String contentId,
                                   String contentMimeType,
                                   InputStream content); String addContent(String spaceId,
                             String contentId,
                             String contentMimeType,
                             Map<String, String> userProperties,
                             long contentSize,
                             String contentChecksum,
                             InputStream content); @Override String copyContent(String sourceSpaceId,
                              String sourceContentId,
                              String destSpaceId,
                              String destContentId); RetrievedContent getContent(String spaceId, String contentId); RetrievedContent getContent(String spaceId, String contentId, String range); void deleteContent(String spaceId, String contentId); void setContentProperties(String spaceId,
                                     String contentId,
                                     Map<String, String> contentProperties); Map<String, String> getContentProperties(String spaceId,
                                                    String contentId); @Override Map<String, String> getSpaceProperties(String spaceId); String getBucketName(String spaceId); static final String HIDDEN_SPACE_PREFIX; }
@Test public void testGetSpaceCount1000() { MockS3StorageProvider provider = new MockS3StorageProvider(); String count = provider.getSpaceCount(spaceId, 1000); assertEquals("1000+", count); count = provider.getSpaceCount(spaceId, 1500); assertEquals("2000+", count); count = provider.getSpaceCount(spaceId, 10000); assertEquals("10000+", count); }