ImageUtil { public static Rational rotate( Rational rational, @RotationValue int rotation) { if (rotation == 90 || rotation == 270) { return inverseRational(rational); } return rational; } private  ImageUtil(); static byte[] imageToJpegByteArray(ImageProxy image); static byte[] cropByteArray(byte[] data, Rect cropRect); static boolean isAspectRatioValid(Rational aspectRatio); static boolean isAspectRatioValid(Size sourceSize, Rational aspectRatio); static Rect computeCropRectFromAspectRatio(Size sourceSize, Rational aspectRatio); static Rational rotate(
            Rational rational, @RotationValue int rotation);  }
@Test public void canRotateRationalByDegree() { Rational resultRatio = ImageUtil.rotate(ASPECT_RATIO, 0); assertThat(resultRatio).isEqualTo(ASPECT_RATIO); resultRatio = ImageUtil.rotate(ASPECT_RATIO, 90); assertThat(resultRatio).isEqualTo( new Rational(ASPECT_RATIO.getDenominator(), ASPECT_RATIO.getNumerator())); }