@Test
public void testListObjectNames_prefixDir_delimiter() throws IOException {

  String prefixADir = PREFIX_A + "/";
  String prefixABADir = PREFIX_ABA.substring(0, PREFIX_ABA.lastIndexOf('/') + 1);
  GoogleCloudStorageItemInfo itemABAPrefix = createInferredDirectory(BUCKET_A, prefixABADir);
  List<String> expectedResult =
      Lists.newArrayList(ITEM_A_AA.getObjectName(), itemABAPrefix.getObjectName());
  List<GoogleCloudStorageItemInfo> expectedCached = Lists.newArrayList(ITEM_A_AA, itemABAPrefix);
  List<String> result = gcs.listObjectNames(BUCKET_A, prefixADir, ListObjectOptions.DEFAULT);
  // Verify the delegate call.
  verify(gcsDelegate)
      .listObjectNames(eq(BUCKET_A), eq(prefixADir), eq(ListObjectOptions.DEFAULT));
  // Verify the result.
  assertThat(result).containsExactlyElementsIn(expectedResult);
  // Verify the state of the cache.
  assertThat(cache.getAllItemsRaw()).containsExactlyElementsIn(expectedCached);
}