FutureOptionMarginResolver { public boolean isMargined(String exchangeCode) { if (EXCHANGE_CODE_MARGIN_MAPPING.containsKey(exchangeCode)) { return EXCHANGE_CODE_MARGIN_MAPPING.get(exchangeCode); } else { throw new OpenGammaRuntimeException("Cannot calculate margined flag from exchangeCode: " + exchangeCode); } }  boolean isMargined(String exchangeCode);  }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void testUnknownExchangeThrowsException() { new FutureOptionMarginResolver().isMargined("NOT_AN_EXCHANGE"); }