Buggy code:
public class LoanBusinessService implements BusinessService { private LegacyLoanDao legacyLoanDao = ApplicationContextProvider . getBean ( LegacyLoanDao . class ) ; private ConfigurationBusinessService configService = new ConfigurationBusinessService ( ) ; @ Autowired private AccountBusinessService accountBusinessService ; @ Autowired private HolidayService holidayService ; @ Autowired private ScheduleCalculatorAdaptor scheduleCalculatorAdaptor ; public LegacyLoanDao getlegacyLoanDao ( ) { } public ConfigurationBusinessService getConfigService ( ) { } public AccountBusinessService getAccountBusinessService ( ) { } protected LoanBusinessService ( ) { } public LoanBusinessService ( LegacyLoanDao legacyLoanDao , ConfigurationBusinessService configService , AccountBusinessService accountBusinessService , HolidayService holidayService , ScheduleCalculatorAdaptor scheduleCalculatorAdaptor ) { } @ Override public AbstractBusinessObject getBusinessObject ( @ SuppressWarnings ( "unused" ) final UserContext userContext ) { } @ Deprecated public LoanBO findBySystemId ( final String accountGlobalNum ) throws ServiceException { } @ Deprecated public List < LoanBO > findIndividualLoans ( final String accountId ) throws ServiceException { } @ Deprecated public LoanBO getAccount ( final Integer accountId ) throws ServiceException { } public List < LoanBO > getLoanAccountsActiveInGoodBadStanding ( final Integer customerId ) throws ServiceException { } public Short getLastPaymentAction ( final Integer accountId ) throws ServiceException { } public List < LoanBO > getSearchResults ( final String officeId , final String personnelId , final String currentStatus ) throws ServiceException { } public List < LoanBO > getAllLoanAccounts ( ) throws ServiceException { } public List < LoanBO > getAllChildrenForParentGlobalAccountNum ( final String globalAccountNum ) throws ServiceException { } public List < LoanBO > getActiveLoansForAllClientsAssociatedWithGroupLoan ( final LoanBO loan ) throws ServiceException { } private Collection < CustomerBO > getClientsAssociatedWithGroupLoan ( final LoanBO loan ) throws ServiceException { } public List < RepaymentScheduleInstallment > applyDailyInterestRatesWhereApplicable ( LoanScheduleGenerationDto loanScheduleGenerationDto , Locale locale ) { } private boolean dailyInterestRatesApplicable ( LoanScheduleGenerationDto loanScheduleGenerationDto , LoanBO loanBO ) { } public void applyDailyInterestRates ( LoanScheduleGenerationDto loanScheduleGenerationDto , boolean flatInterestType ) { } private Money computeInterestAmount ( Double dailyInterestFactor , Money principalOutstanding , RepaymentScheduleInstallment installment , long duration ) { } public void adjustInstallmentGapsPostDisbursal ( List < RepaymentScheduleInstallment > installments , Date oldDisbursementDate , Date newDisbursementDate , Short officeId ) { } public void adjustDatesForVariableInstallments ( boolean variableInstallmentsAllowed , boolean fixedRepaymentSchedule , List < RepaymentScheduleInstallment > originalInstallments , Date oldDisbursementDate , Date newDisbursementDate , Short officeId ) { } public List < RepaymentScheduleInstallment > applyDailyInterestRatesWhereApplicable ( LoanScheduleGenerationDto loanScheduleGenerationDto , List < RepaymentScheduleInstallment > installments ) { } public void applyPayment ( PaymentData paymentData , LoanBO loanBO , AccountPaymentEntity accountPaymentEntity ) { } public void persistOriginalSchedule ( LoanBO loan ) throws PersistenceException { } public List < OriginalLoanScheduleEntity > retrieveOriginalLoanSchedule ( Integer accountId ) throws PersistenceException { } public Errors computeExtraInterest ( LoanBO loan , Date asOfDate ) { } private void validateForComputeExtraInterestDate ( LoanBO loan , Date extraInterestDate , Errors errors ) { } public List < ApplicableCharge > getAppllicablePenalties ( Integer accountId , UserContext userContext ) throws ServiceException { } private void addMiscPenalty ( List < ApplicableCharge > applicableChargeList ) { ApplicableCharge applicableCharge = new ApplicableCharge ( ) ; applicableCharge . setFeeId ( MISC_PENALTY ) ; applicableCharge . setFeeName ( "Misc<seq2seq4repair_space>Penalty" ) ; applicableCharge . setIsRateType ( false ) ; <START_BUG> applicableCharge . setIsPenaltyType ( true ) ; <END_BUG> applicableChargeList . add ( applicableCharge ) ; } private List < ApplicableCharge > getLoanApplicablePenalties ( List < PenaltyBO > penaltyList , UserContext userContext , LoanBO loanBO ) { } private void filterBasedOnCurrencyOfLoan ( List < PenaltyBO > penaltyList , LoanBO loanBO ) { } private void populaleApplicableCharge ( List < ApplicableCharge > applicableChargeList , List < PenaltyBO > penaltyList , UserContext userContext ) { } }

Fix:
applicableCharge . setIsPenaltyType ( false ) ;