private void compareAndTest(CostBenefitInfo actual, long costDiff, int benefitDiff, int comparisonValue) {
    CostBenefitInfo newCostBenefitInfo = new CostBenefitInfo(actual.getSegmentsToCompact(), actual.getCost() + costDiff,
        actual.getBenefit() + benefitDiff);
    assertTrue("Cost Benefit info comparison mismatch ", actual.compareTo(newCostBenefitInfo) == comparisonValue);
    assertTrue("Cost Benefit info comparison mismatch ", newCostBenefitInfo.compareTo(actual) == comparisonValue * -1);
  }
Compares the {@code actual} {@link CostBenefitInfo} with a new one that is generated based on the arguments passed
@param actual Actual {@link CostBenefitInfo} to be compared against
@param costDiff cost difference to generate the new {@link CostBenefitInfo} wrt {@code actual}
@param benefitDiff benefit difference to generate the new {@link CostBenefitInfo} wrt {@code actual}
@param comparisonValue expected comparison value
ambry-store/src/test/java/com/github/ambry/store/CostBenefitInfoTest.java