public static QuotedSpread getQuotedSpread( CDSQuoteConvention quote, PointsUpFront puf, BuySellProtection buySellProtection, ISDACompliantYieldCurve yieldCurve, CDSAnalytic analytic) { double quotedSpread; if (quote instanceof QuotedSpread) { return (QuotedSpread) quote; } else { quotedSpread = POINTS_UP_FRONT_CONVERTER.pufToQuotedSpread( analytic, puf.getCoupon(), yieldCurve, puf.getPointsUpFront()); } // SELL protection reverses directions of legs quotedSpread = (buySellProtection == BuySellProtection.SELL) ? -quotedSpread : quotedSpread; return new QuotedSpread(quote.getCoupon(), quotedSpread); }