@Test public void testSkipAllWithoutAdCount() { state = state.withSkippedAdGroup(0); state = state.withSkippedAdGroup(1); assertThat(state.adGroups[0].count).isEqualTo(0); assertThat(state.adGroups[1].count).isEqualTo(0); }
@CheckResult public AdPlaybackState withSkippedAdGroup(int adGroupIndex) { AdGroup[] adGroups = Arrays.copyOf(this.adGroups, this.adGroups.length); adGroups[adGroupIndex] = adGroups[adGroupIndex].withAllAdsSkipped(); return new AdPlaybackState(adGroupTimesUs, adGroups, adResumePositionUs, contentDurationUs); }
AdPlaybackState { @CheckResult public AdPlaybackState withSkippedAdGroup(int adGroupIndex) { AdGroup[] adGroups = Arrays.copyOf(this.adGroups, this.adGroups.length); adGroups[adGroupIndex] = adGroups[adGroupIndex].withAllAdsSkipped(); return new AdPlaybackState(adGroupTimesUs, adGroups, adResumePositionUs, contentDurationUs); } }
AdPlaybackState { @CheckResult public AdPlaybackState withSkippedAdGroup(int adGroupIndex) { AdGroup[] adGroups = Arrays.copyOf(this.adGroups, this.adGroups.length); adGroups[adGroupIndex] = adGroups[adGroupIndex].withAllAdsSkipped(); return new AdPlaybackState(adGroupTimesUs, adGroups, adResumePositionUs, contentDurationUs); } AdPlaybackState(long... adGroupTimesUs); private  AdPlaybackState(
      long[] adGroupTimesUs, AdGroup[] adGroups, long adResumePositionUs, long contentDurationUs); }
AdPlaybackState { @CheckResult public AdPlaybackState withSkippedAdGroup(int adGroupIndex) { AdGroup[] adGroups = Arrays.copyOf(this.adGroups, this.adGroups.length); adGroups[adGroupIndex] = adGroups[adGroupIndex].withAllAdsSkipped(); return new AdPlaybackState(adGroupTimesUs, adGroups, adResumePositionUs, contentDurationUs); } AdPlaybackState(long... adGroupTimesUs); private  AdPlaybackState(
      long[] adGroupTimesUs, AdGroup[] adGroups, long adResumePositionUs, long contentDurationUs); int getAdGroupIndexForPositionUs(long positionUs); int getAdGroupIndexAfterPositionUs(long positionUs, long periodDurationUs); @CheckResult AdPlaybackState withAdCount(int adGroupIndex, int adCount); @CheckResult AdPlaybackState withAdUri(int adGroupIndex, int adIndexInAdGroup, Uri uri); @CheckResult AdPlaybackState withPlayedAd(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withSkippedAd(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withAdLoadError(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withSkippedAdGroup(int adGroupIndex); @CheckResult AdPlaybackState withAdDurationsUs(long[][] adDurationUs); @CheckResult AdPlaybackState withAdResumePositionUs(long adResumePositionUs); @CheckResult AdPlaybackState withContentDurationUs(long contentDurationUs); @Override boolean equals(Object o); @Override int hashCode(); }
AdPlaybackState { @CheckResult public AdPlaybackState withSkippedAdGroup(int adGroupIndex) { AdGroup[] adGroups = Arrays.copyOf(this.adGroups, this.adGroups.length); adGroups[adGroupIndex] = adGroups[adGroupIndex].withAllAdsSkipped(); return new AdPlaybackState(adGroupTimesUs, adGroups, adResumePositionUs, contentDurationUs); } AdPlaybackState(long... adGroupTimesUs); private  AdPlaybackState(
      long[] adGroupTimesUs, AdGroup[] adGroups, long adResumePositionUs, long contentDurationUs); int getAdGroupIndexForPositionUs(long positionUs); int getAdGroupIndexAfterPositionUs(long positionUs, long periodDurationUs); @CheckResult AdPlaybackState withAdCount(int adGroupIndex, int adCount); @CheckResult AdPlaybackState withAdUri(int adGroupIndex, int adIndexInAdGroup, Uri uri); @CheckResult AdPlaybackState withPlayedAd(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withSkippedAd(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withAdLoadError(int adGroupIndex, int adIndexInAdGroup); @CheckResult AdPlaybackState withSkippedAdGroup(int adGroupIndex); @CheckResult AdPlaybackState withAdDurationsUs(long[][] adDurationUs); @CheckResult AdPlaybackState withAdResumePositionUs(long adResumePositionUs); @CheckResult AdPlaybackState withContentDurationUs(long contentDurationUs); @Override boolean equals(Object o); @Override int hashCode(); static final int AD_STATE_UNAVAILABLE; static final int AD_STATE_AVAILABLE; static final int AD_STATE_SKIPPED; static final int AD_STATE_PLAYED; static final int AD_STATE_ERROR; static final AdPlaybackState NONE; final int adGroupCount; final long[] adGroupTimesUs; final AdGroup[] adGroups; final long adResumePositionUs; final long contentDurationUs; }