### Question:
EllipticIIRDesigner extends AbstractIIRDesigner { @Override protected double[] calculateNaturalFrequency(FilterType type, int filterOrder, double[] wp, double[] ws, double gpass, double gstop, boolean analog) throws BadFilterParametersException { if (type.isBandstop()) { double[] passb; double[] stopb; if (!analog) { passb = prewarpFrequencies(wp); stopb = prewarpFrequencies(ws); } else { passb = wp.clone(); stopb = ws.clone(); } double[] result = optimizeBandstopFilterPassbandFrequencies(passb, stopb, gpass, gstop); passb[0] = result[0]; passb[1] = result[1]; if (!analog) passb = unwarpFrequencies(passb); return passb; } return wp; }    }### Answer:
@Test public void testCalculateNaturalFrequency() throws BadFilterParametersException { double[] wn; wn = iirdesigner.calculateNaturalFrequency(FilterType.BANDPASS, 7, new double[] {0.6, 0.7}, new double[] {0.55, 0.8}, 0.5, 100, true); assertEquals(new double[] {0.6, 0.7}, wn, 1e-16); wn = iirdesigner.calculateNaturalFrequency(FilterType.BANDSTOP, 3, new double[] {0.3, 0.9}, new double[] {0.5, 0.7}, 3.0, 40.0, true); assertEquals(new double[] {0.38888824, 0.89999518}, wn, 1e-4); wn = iirdesigner.calculateNaturalFrequency(FilterType.BANDSTOP, 3, new double[] {0.3, 0.9}, new double[] {0.5, 0.7}, 3.0, 40.0, false); assertEquals(new double[] {0.30000218, 0.83829193}, wn, 1e-5); wn = iirdesigner.calculateNaturalFrequency(FilterType.BANDSTOP, 8, new double[] {0.5, 0.8}, new double[] {0.55, 0.7}, 0.5, 100, true); assertEquals(new double[] {0.50000531, 0.7699937}, wn, 1e-5); }