### Question:
SummarizerUtils { public static PortfolioItemSummary summary(Position position, ProductType type, String description, Currency... currencies) { return PortfolioItemSummary.of( position.getId().orElse(null), PortfolioItemType.POSITION, type, ImmutableSet.copyOf(currencies), description); } private  SummarizerUtils(); static String date(LocalDate date); static String dateRange(LocalDate start, LocalDate end); static String datePeriod(LocalDate start, LocalDate end); static String amount(CurrencyAmount currencyAmount); static String amount(Currency currency, double value); static String value(double value); static String percent(double value); static String payReceive(PayReceive payReceive); static String fx(CurrencyAmount base, CurrencyAmount counter); static PortfolioItemSummary summary(Position position, ProductType type, String description, Currency... currencies); static PortfolioItemSummary summary(Trade trade, ProductType type, String description, Currency... currencies);  }### Answer:
@Test public void test_summary_position() { StandardId id = StandardId.of("X", "Y"); SecurityPosition position = SecurityPosition.builder() .securityId(SecurityId.of("A", "B")) .longQuantity(123) .info(PositionInfo.of(id)) .build(); String description = "desc"; PortfolioItemSummary expected = PortfolioItemSummary.of( id, PortfolioItemType.POSITION, ProductType.SECURITY, ImmutableSet.of(GBP), description); assertThat(SummarizerUtils.summary(position, ProductType.SECURITY, description, GBP)).isEqualTo(expected); }
@Test public void test_summary_trade() { StandardId id = StandardId.of("X", "Y"); Trade trade = new Trade() { @Override public TradeInfo getInfo() { return TradeInfo.builder().id(id).build(); } @Override public Trade withInfo(PortfolioItemInfo info) { return this; } }; String description = "desc"; PortfolioItemSummary expected = PortfolioItemSummary.of( id, PortfolioItemType.TRADE, ProductType.FRA, ImmutableSet.of(GBP), description); assertThat(SummarizerUtils.summary(trade, ProductType.FRA, description, GBP)).isEqualTo(expected); }