Validate.notNull(underlyingData, "underlying data");
Validate.notEmpty(underlyingData, "underlying data");
Validate.noNullElements(underlyingData.keySet(), "underlying data keys");
Validate.noNullElements(underlyingData.values(), "underlying data values");
if (underlying instanceof NthOrderUnderlying) {
final NthOrderUnderlying nthOrder = (NthOrderUnderlying) underlying;
final int n = nthOrder.getOrder();
if (n == 0) {
return 1;
}
final UnderlyingType type = nthOrder.getUnderlying();
Validate.isTrue(underlyingData.containsKey(type));
final double value = Math.pow(underlyingData.get(type), n);
return value * getMultiplier(underlying);
} else if (underlying instanceof MixedOrderUnderlying) {
final MixedOrderUnderlying mixedOrder = (MixedOrderUnderlying) underlying;