### Question:
FilterCoefficients { protected void transformLowpassToHighpass(double w0) throws BadFilterParametersException { int numberOfCoeffs = getNumberOfCoefficients(); double[] powers = new double[numberOfCoeffs]; int i; for (i = 0; i < numberOfCoeffs; i++) { if (w0 != 1) powers[i] = Math.pow(w0, i); else powers[i] = 1.0; } double[] outa; double[] outb; if (aCoefficients.length >= bCoefficients.length) { outa = new double[aCoefficients.length]; for (i = 0; i < aCoefficients.length; i++) outa[i] = aCoefficients[aCoefficients.length - i - 1] * powers[i]; outb = new double[aCoefficients.length]; for (i = 0; i < bCoefficients.length; i++) outb[i] = bCoefficients[bCoefficients.length - i - 1] * powers[i]; for (i = bCoefficients.length; i < aCoefficients.length; i++) outb[i] = 0.0; } else { outb = new double[bCoefficients.length]; for (i = 0; i < bCoefficients.length; i++) outb[i] = bCoefficients[bCoefficients.length - i - 1] * powers[i]; outa = new double[bCoefficients.length]; for (i = 0; i < aCoefficients.length; i++) outa[i] = aCoefficients[aCoefficients.length - i - 1] * powers[i]; for (i = aCoefficients.length; i < bCoefficients.length; i++) outb[i] = 0.0; } aCoefficients = outa; bCoefficients = outb; normalize(); } FilterCoefficients(double[] bCoefficients, double[] aCoefficients); int getFilterOrder(); int getNumberOfCoefficients(); double[] getACoefficients(); double[] getBCoefficients(); @Override boolean equals(Object o); @Override int hashCode(); void print(); @Override String toString();  }### Answer:
@Test public void testTransformLowpassToHighpass() throws BadFilterParametersException { double[] b = new double[] {0.06264858}; double[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711, 0.40796631, 0.06264858 }; FilterCoefficients coeffs = new FilterCoefficients(b, a); double[] pythonB = new double[] {1, 0, 0, 0, 0, 0}; double[] pythonA = new double[] {1.00000000e+00, 1.95359404e+01, 7.88594723e+01, 6.09841090e+02, 7.42786214e+02, 3.87877901e+03 }; coeffs.transformLowpassToHighpass(3.0); assertEquals(new FilterCoefficients(pythonB, pythonA), coeffs, 1e-4); }