@Test public void minimumRewardAmountByVariant() { final Reward noReward = RewardFactory.noReward(); assertEquals(1.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.CONTROL, noReward, 1)); assertEquals(10.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_2, noReward, 1)); assertEquals(20.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_3, noReward, 1)); assertEquals(50.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_4, noReward, 1)); assertEquals(10.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.CONTROL, noReward, 10)); assertEquals(100.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_4, noReward, 100)); assertEquals(100.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_3, noReward, 100)); assertEquals(100.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_2, noReward, 100)); assertEquals(100.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.CONTROL, noReward, 100)); assertEquals(50.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_4, noReward, 5)); assertEquals(10.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_2, noReward, 5)); assertEquals(20.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.VARIANT_3, noReward, 5)); assertEquals(5.0, RewardUtils.rewardAmountByVariant(OptimizelyExperiment.Variant.CONTROL, noReward, 5)); }
public static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge) { Double value = reward.minimum(); switch (variant) { case CONTROL: value = 1.0; break; case VARIANT_2: value = 10.0; break; case VARIANT_3: value = 20.0; break; case VARIANT_4: value = 50.0; break; } return value < minPledge ? minPledge : value; }
RewardUtils { public static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge) { Double value = reward.minimum(); switch (variant) { case CONTROL: value = 1.0; break; case VARIANT_2: value = 10.0; break; case VARIANT_3: value = 20.0; break; case VARIANT_4: value = 50.0; break; } return value < minPledge ? minPledge : value; } }
RewardUtils { public static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge) { Double value = reward.minimum(); switch (variant) { case CONTROL: value = 1.0; break; case VARIANT_2: value = 10.0; break; case VARIANT_3: value = 20.0; break; case VARIANT_4: value = 50.0; break; } return value < minPledge ? minPledge : value; } private  RewardUtils(); }
RewardUtils { public static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge) { Double value = reward.minimum(); switch (variant) { case CONTROL: value = 1.0; break; case VARIANT_2: value = 10.0; break; case VARIANT_3: value = 20.0; break; case VARIANT_4: value = 50.0; break; } return value < minPledge ? minPledge : value; } private  RewardUtils(); static boolean hasBackers(final @NonNull Reward reward); static boolean isAvailable(final @NonNull Project project, final @NonNull Reward reward); static boolean isExpired(final @NonNull Reward reward); static boolean isItemized(final @NonNull Reward reward); static boolean isLimited(final @NonNull Reward reward); static boolean isLimitReached(final @NonNull Reward reward); static boolean isNoReward(final @NonNull Reward reward); static boolean isReward(final @NonNull Reward reward); static boolean isShippable(final @NonNull Reward reward); static boolean isTimeLimited(final @NonNull Reward reward); static @NonNull String deadlineCountdownDetail(final @NonNull Reward reward, final @NonNull Context context,
    final @NonNull KSString ksString); static @NonNull String deadlineCountdownUnit(final @NonNull Reward reward, final @NonNull Context context); static Pair<Integer, String> shippingSummary(final @NonNull Reward reward); static @NonNull Long timeInSecondsUntilDeadline(final @NonNull Reward reward); static int deadlineCountdownValue(final @NonNull Reward reward); static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge); }
RewardUtils { public static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge) { Double value = reward.minimum(); switch (variant) { case CONTROL: value = 1.0; break; case VARIANT_2: value = 10.0; break; case VARIANT_3: value = 20.0; break; case VARIANT_4: value = 50.0; break; } return value < minPledge ? minPledge : value; } private  RewardUtils(); static boolean hasBackers(final @NonNull Reward reward); static boolean isAvailable(final @NonNull Project project, final @NonNull Reward reward); static boolean isExpired(final @NonNull Reward reward); static boolean isItemized(final @NonNull Reward reward); static boolean isLimited(final @NonNull Reward reward); static boolean isLimitReached(final @NonNull Reward reward); static boolean isNoReward(final @NonNull Reward reward); static boolean isReward(final @NonNull Reward reward); static boolean isShippable(final @NonNull Reward reward); static boolean isTimeLimited(final @NonNull Reward reward); static @NonNull String deadlineCountdownDetail(final @NonNull Reward reward, final @NonNull Context context,
    final @NonNull KSString ksString); static @NonNull String deadlineCountdownUnit(final @NonNull Reward reward, final @NonNull Context context); static Pair<Integer, String> shippingSummary(final @NonNull Reward reward); static @NonNull Long timeInSecondsUntilDeadline(final @NonNull Reward reward); static int deadlineCountdownValue(final @NonNull Reward reward); static Double rewardAmountByVariant(final OptimizelyExperiment.Variant variant, final Reward reward, final Integer minPledge);  }