CounterpartyExposureFunction implements ExposureFunction { @Override public List<ExternalId> getIds(Trade trade) { return Lists.newArrayList(trade.getCounterparty().getExternalId()); }  @Override String getName(); @Override List<ExternalId> getIds(Trade trade); static final String NAME; }
@Test public void testCounterparty() { FRASecurity security = ExposureFunctionTestHelper.getFRASecurity(); Trade trade = new SimpleTrade(security, BigDecimal.ONE, COUNTERPARTY, LocalDate.now(), OffsetTime.now()); assertEquals(COUNTERPARTY_ID, EXPOSURE_FUNCTION.getIds(trade).get(0)); }