void archive(ScanResults scanResults) throws InvalidProtocolBufferException {
    if (!Strings.isNullOrEmpty(options.localOutputFilename)) {
      archive(rawFileArchiver, options.localOutputFilename, options.localOutputFormat, scanResults);
    }

    if (!Strings.isNullOrEmpty(options.gcsOutputFileUrl)) {
      GoogleCloudStorageArchiver archiver =
          googleCloudStorageArchiverFactory.create(getGcsStorage());
      archive(archiver, options.gcsOutputFileUrl, options.gcsOutputFormat, scanResults);
    }
  }
@Test
  public void archive_withLocalFileEnabledForBinProtoOutput_storesBytesDataLocally()
      throws InvalidProtocolBufferException {
    options.localOutputFilename = "/tmp/test.binproto";
    options.localOutputFormat = OutputDataFormat.BIN_PROTO;
    options.gcsOutputFileUrl = "";

    scanResultsArchiver.archive(SCAN_RESULTS);

    assertThat(
            ScanResults.parseFrom(
                fakeRawFileArchiver.getStoredByteArrays("/tmp/test.binproto")))
        .isEqualTo(SCAN_RESULTS);
    fakeGoogleCloudStorageArchivers.assertNoDataStored();
  }