### Question:
FetchBlobMetadata implements Function<PageSet<? extends StorageMetadata>, PageSet<? extends StorageMetadata>> { public PageSet<? extends StorageMetadata> apply(PageSet<? extends StorageMetadata> in) { checkState(container != null, "container name should be initialized"); if (in == null) { return new PageSetImpl<>(Collections.<StorageMetadata>emptyList(), null); } Map<String, StorageMetadata> orderedMap = new LinkedHashMap<>(in.size()); for (StorageMetadata storageMetadata : in) { orderedMap.put(storageMetadata.getName(), null); } Iterable<StorageMetadata> returnv = Lists.newArrayList(transformParallel(in, new Function<StorageMetadata, ListenableFuture<? extends StorageMetadata>>() { @Override public ListenableFuture<StorageMetadata> apply(final StorageMetadata from) { if (from.getType() != StorageType.BLOB) { return Futures.immediateFuture(from); } return userExecutor.submit(new Callable<StorageMetadata>() { @Override public StorageMetadata call() { return blobstore.blobMetadata(container, from.getName()); } }); } }, userExecutor, maxTime, logger, String.format("getting metadata from containerName: %s", container))); for (StorageMetadata storageMetadata : returnv) { orderedMap.put(storageMetadata.getName(), storageMetadata); } return new PageSetImpl<>(orderedMap.values(), in.getNextMarker()); } @Inject  FetchBlobMetadata(@Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, BlobStore blobstore,
            BackoffLimitedRetryHandler retryHandler); FetchBlobMetadata setContainerName(String container); PageSet<? extends StorageMetadata> apply(PageSet<? extends StorageMetadata> in);  }### Answer:
@Test public void testRetainsOriginalOrder() { blobStore.createContainerInLocation(null, CONTAINER_NAME); for (int blobIndex = 0; blobIndex < 20; blobIndex++) { final Blob blob = blobStore.blobBuilder("prefix-" + blobIndex).payload("").build(); blobStore.putBlob(CONTAINER_NAME, blob); } final PageSet<? extends StorageMetadata> pageSet = blobStore.list(CONTAINER_NAME, ListContainerOptions.Builder.withDetails()); final PageSet<? extends StorageMetadata> resultPageSet = fetchBlobMetadata.apply(pageSet); assertNotNull(resultPageSet); assertTrue(Ordering.from(new Comparator<StorageMetadata>() { @Override public int compare(StorageMetadata o1, StorageMetadata o2) { return o1.getName().compareTo(o2.getName()); } }).isOrdered(resultPageSet)); }