@Test public void initialState_isDesired() { assertThat(noAds.shouldPlaceAd(0)).isFalse(); assertThat(noAds.shouldPlaceAd(1)).isFalse(); assertThat(noAds.shouldPlaceAd(2)).isFalse(); assertThat(noAds.shouldPlaceAd(3)).isFalse(); assertThat(noAds.shouldPlaceAd(4)).isFalse(); assertThat(adAt0.shouldPlaceAd(0)).isTrue(); assertThat(adAt0.shouldPlaceAd(1)).isFalse(); assertThat(adAt0.shouldPlaceAd(2)).isFalse(); assertThat(adAt0.shouldPlaceAd(3)).isFalse(); assertThat(adAt0.shouldPlaceAd(4)).isFalse(); assertThat(adAt1.shouldPlaceAd(0)).isFalse(); assertThat(adAt1.shouldPlaceAd(1)).isTrue(); assertThat(adAt1.shouldPlaceAd(2)).isFalse(); assertThat(adAt1.shouldPlaceAd(3)).isFalse(); assertThat(adAt1.shouldPlaceAd(4)).isFalse(); assertThat(adsAt01.shouldPlaceAd(0)).isTrue(); assertThat(adsAt01.shouldPlaceAd(1)).isFalse(); assertThat(adsAt01.shouldPlaceAd(2)).isFalse(); assertThat(adsAt01.shouldPlaceAd(3)).isFalse(); assertThat(adsAt01.shouldPlaceAd(4)).isFalse(); assertThat(adsAt14.shouldPlaceAd(0)).isFalse(); assertThat(adsAt14.shouldPlaceAd(1)).isTrue(); assertThat(adsAt14.shouldPlaceAd(2)).isFalse(); assertThat(adsAt14.shouldPlaceAd(3)).isTrue(); assertThat(adsAt14.shouldPlaceAd(4)).isFalse(); assertThat(adsRepeating.shouldPlaceAd(0)).isFalse(); assertThat(adsRepeating.shouldPlaceAd(1)).isFalse(); assertThat(adsRepeating.shouldPlaceAd(2)).isTrue(); assertThat(adsRepeating.shouldPlaceAd(3)).isFalse(); assertThat(adsRepeating.shouldPlaceAd(4)).isTrue(); assertThat(adsRepeating.shouldPlaceAd(5)).isFalse(); assertThat(adsRepeating.shouldPlaceAd(6)).isTrue(); assertThat(adsAt15repeating.shouldPlaceAd(0)).isFalse(); assertThat(adsAt15repeating.shouldPlaceAd(1)).isTrue(); assertThat(adsAt15repeating.shouldPlaceAd(2)).isFalse(); assertThat(adsAt15repeating.shouldPlaceAd(3)).isFalse(); assertThat(adsAt15repeating.shouldPlaceAd(4)).isTrue(); assertThat(adsAt15repeating.shouldPlaceAd(5)).isFalse(); assertThat(adsAt15repeating.shouldPlaceAd(6)).isTrue(); assertThat(adsAt15repeating.shouldPlaceAd(7)).isFalse(); assertThat(adsAt15repeating.shouldPlaceAd(8)).isTrue(); assertThat(adsAt1234.shouldPlaceAd(0)).isFalse(); assertThat(adsAt1234.shouldPlaceAd(1)).isTrue(); assertThat(adsAt1234.shouldPlaceAd(2)).isFalse(); assertThat(adsAt1234.shouldPlaceAd(3)).isFalse(); }
boolean shouldPlaceAd(final int position) { final int index = binarySearch(mDesiredInsertionPositions, 0, mDesiredCount, position); return index >= 0; }
PlacementData { boolean shouldPlaceAd(final int position) { final int index = binarySearch(mDesiredInsertionPositions, 0, mDesiredCount, position); return index >= 0; } }
PlacementData { boolean shouldPlaceAd(final int position) { final int index = binarySearch(mDesiredInsertionPositions, 0, mDesiredCount, position); return index >= 0; } private  PlacementData(@NonNull final int[] desiredInsertionPositions); }
PlacementData { boolean shouldPlaceAd(final int position) { final int index = binarySearch(mDesiredInsertionPositions, 0, mDesiredCount, position); return index >= 0; } private  PlacementData(@NonNull final int[] desiredInsertionPositions);  }
PlacementData { boolean shouldPlaceAd(final int position) { final int index = binarySearch(mDesiredInsertionPositions, 0, mDesiredCount, position); return index >= 0; } private  PlacementData(@NonNull final int[] desiredInsertionPositions);  final static int NOT_FOUND; }