### Question:
OfflineLicenseHelper { public synchronized byte[] downloadLicense(DrmInitData drmInitData) throws DrmSessionException { Assertions.checkArgument(drmInitData != null); return blockingKeyRequest(DefaultDrmSessionManager.MODE_DOWNLOAD, null, drmInitData); } OfflineLicenseHelper(
      UUID uuid,
      ExoMediaDrm<T> mediaDrm,
      MediaDrmCallback callback,
      @Nullable HashMap<String, String> optionalKeyRequestParameters); static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(
      String defaultLicenseUrl, Factory httpDataSourceFactory); static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(
      String defaultLicenseUrl, boolean forceDefaultLicenseUrl, Factory httpDataSourceFactory); static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(
      String defaultLicenseUrl,
      boolean forceDefaultLicenseUrl,
      Factory httpDataSourceFactory,
      @Nullable HashMap<String, String> optionalKeyRequestParameters); synchronized byte[] getPropertyByteArray(String key); synchronized void setPropertyByteArray(String key, byte[] value); synchronized String getPropertyString(String key); synchronized void setPropertyString(String key, String value); synchronized byte[] downloadLicense(DrmInitData drmInitData); synchronized byte[] renewLicense(byte[] offlineLicenseKeySetId); synchronized void releaseLicense(byte[] offlineLicenseKeySetId); synchronized Pair<Long, Long> getLicenseDurationRemainingSec(byte[] offlineLicenseKeySetId); void release();  }### Answer:
@Test public void testDownloadLicenseFailsIfNullInitData() throws Exception { try { offlineLicenseHelper.downloadLicense(null); fail(); } catch (IllegalArgumentException e) { } }
@Test public void testDownloadLicenseFailsIfNoKeySetIdIsReturned() throws Exception { setStubLicenseAndPlaybackDurationValues(1000, 200); try { offlineLicenseHelper.downloadLicense(newDrmInitData()); fail(); } catch (Exception e) { } }
@Test public void testDownloadLicenseDoesNotFailIfDurationNotAvailable() throws Exception { setDefaultStubKeySetId(); byte[] offlineLicenseKeySetId = offlineLicenseHelper.downloadLicense(newDrmInitData()); assertThat(offlineLicenseKeySetId).isNotNull(); }