VolatilityFunctionFactory { public static VolatilityFunctionProvider<?> getCalculator(final String name) { final VolatilityFunctionProvider<?> calculator = s_instances.get(name); if (calculator != null) { return calculator; } throw new IllegalArgumentException("Could not get calculator for " + name); } private  VolatilityFunctionFactory(); static VolatilityFunctionProvider<?> getCalculator(final String name); static String getCalculatorName(final VolatilityFunctionProvider<?> calculator); static final String HAGAN; static final String ALTERNATIVE_HAGAN; static final String BERESTYCKI; static final String JOHNSON; static final String PAULOT; static final SABRHaganVolatilityFunction HAGAN_FORMULA; static final SABRHaganAlternativeVolatilityFunction ALTERNATIVE_HAGAN_FORMULA; static final SABRBerestyckiVolatilityFunction BERESTYCKI_FORMULA; static final SABRJohnsonVolatilityFunction JOHNSON_FORMULA; static final SABRPaulotVolatilityFunction PAULOT_FORMULA; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testWrongName() { VolatilityFunctionFactory.getCalculator("Other"); }