### Question:
ApplyInterestPaymentBuilderService implements PaymentBuilderService { @Override public PaymentBuilder getPaymentBuilder( final DataContextOfAction dataContextOfAction, final BigDecimal ignored, final LocalDate forDate, final RunningBalances runningBalances) { final CaseParametersEntity caseParameters = dataContextOfAction.getCaseParametersEntity(); final String productIdentifier = dataContextOfAction.getProductEntity().getIdentifier(); final int minorCurrencyUnitDigits = dataContextOfAction.getProductEntity().getMinorCurrencyUnitDigits(); final ScheduledAction interestAction = new ScheduledAction(Action.APPLY_INTEREST, forDate, new Period(1, forDate)); final List<ScheduledCharge> scheduledCharges = scheduledChargesService.getScheduledCharges( productIdentifier, Collections.singletonList(interestAction)); return CostComponentService.getCostComponentsForScheduledCharges( scheduledCharges, caseParameters.getBalanceRangeMaximum(), runningBalances, dataContextOfAction.getCaseParametersEntity().getPaymentSize(), BigDecimal.ZERO, BigDecimal.ZERO, dataContextOfAction.getInterest(), minorCurrencyUnitDigits, true); } @Autowired  ApplyInterestPaymentBuilderService(final ScheduledChargesService scheduledChargesService); @Override PaymentBuilder getPaymentBuilder(
      final DataContextOfAction dataContextOfAction,
      final BigDecimal ignored,
      final LocalDate forDate,
      final RunningBalances runningBalances);  }### Answer:
@Test public void getPaymentBuilder() throws Exception { final PaymentBuilderServiceTestCase testCase = new PaymentBuilderServiceTestCase("simple case"); final PaymentBuilder paymentBuilder = PaymentBuilderServiceTestHarness.constructCallToPaymentBuilder( ApplyInterestPaymentBuilderService::new, testCase); final Payment payment = paymentBuilder.buildPayment(Action.APPLY_INTEREST, Collections.emptySet(), testCase.forDate.toLocalDate()); Assert.assertNotNull(payment); Assert.assertEquals(BigDecimal.valueOf(27, 2), paymentBuilder.getBalanceAdjustments().get(AccountDesignators.INTEREST_ACCRUAL)); }