Util { private static String identifyLoan(final Loan loan) { final BigDecimal interestRate = loan.getInterestRate() .asPercentage(); return String.format("č. %d (%.2f %% p.a., %d m.)", loan.getId(), interestRate, loan.getTermInMonths()); } private  Util(); static Date toDate(final LocalDate localDate); static Date toDate(final OffsetDateTime offsetDateTime); static Date toDate(final ZonedDateTime zonedDateTime); static String identifyLoan(final LoanBased event); static Map<String, Object> getLoanData(final Loan loan); static Map<String, Object> getDelinquencyData(final Investment investment); static Map<String, Object> getLoanData(final Investment i, final Loan l); static Map<String, Object> summarizePortfolioStructure(final PortfolioOverview portfolioOverview); static Map<String, Object> summarizePortfolioStructure(final ExtendedPortfolioOverview portfolioOverview); static boolean isNetworkProblem(final Throwable ex); static Map<String, Object> getDelinquentData(final Investment i, final Loan loan, final LocalDate date); static String stackTraceToString(final Throwable t); static String obfuscateEmailAddress(final String username);  }
@Test void identifyLoanBased() { final LoanBased l = new LoanDefaultedEvent() { @Override public OffsetDateTime getCreatedOn() { return OffsetDateTime.now(); } @Override public Loan getLoan() { return new MockLoanBuilder() .set(LoanImpl::setRating, Rating.D) .set(LoanImpl::setInterestRate, Ratio.ONE) .build(); } @Override public Investment getInvestment() { return null; } @Override public LocalDate getDelinquentSince() { return LocalDate.now(); } }; assertThat(Util.identifyLoan(l)).isNotEmpty(); }