public List<StorageObjectOrIOException> getObjects(List<GcsPath> gcsPaths) throws IOException {
    if (gcsPaths.isEmpty()) {
      return ImmutableList.of();
    } else if (gcsPaths.size() == 1) {
      GcsPath path = gcsPaths.get(0);
      try {
        StorageObject object = getObject(path);
        return ImmutableList.of(StorageObjectOrIOException.create(object));
      } catch (IOException e) {
        return ImmutableList.of(StorageObjectOrIOException.create(e));
      } catch (Exception e) {
        IOException ioException =
            new IOException(String.format("Error trying to get %s: %s", path, e));
        return ImmutableList.of(StorageObjectOrIOException.create(ioException));
      }
    }

    List<StorageObjectOrIOException[]> results = new ArrayList<>();
    executeBatches(makeGetBatches(gcsPaths, results));
    ImmutableList.Builder<StorageObjectOrIOException> ret = ImmutableList.builder();
    for (StorageObjectOrIOException[] result : results) {
      ret.add(result[0]);
    }
    return ret.build();
  }
@Test
  public void testGetObjects() throws IOException {
    GcsUtil gcsUtil = gcsOptionsWithTestCredential().getGcsUtil();

    Storage mockStorage = Mockito.mock(Storage.class);
    gcsUtil.setStorageClient(mockStorage);
    gcsUtil.setBatchRequestSupplier(FakeBatcher::new);

    Storage.Objects mockStorageObjects = Mockito.mock(Storage.Objects.class);
    Storage.Objects.Get mockGetRequest = Mockito.mock(Storage.Objects.Get.class);
    StorageObject object = new StorageObject();
    when(mockGetRequest.execute()).thenReturn(object);
    when(mockStorageObjects.get(any(), any())).thenReturn(mockGetRequest);
    when(mockStorage.objects()).thenReturn(mockStorageObjects);

    List<StorageObjectOrIOException> results = gcsUtil.getObjects(makeGcsPaths("s", 1));

    assertEquals(object, results.get(0).storageObject());
  }