RectangleF { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RectangleF rectangle = (RectangleF) o; float epsilon = 0.00000001f; if (!(Math.abs(x-rectangle.x) < epsilon)) return false; if (!(Math.abs(y-rectangle.y) < epsilon)) return false; if (!(Math.abs(width-rectangle.width) < epsilon)) return false; return Math.abs(height - rectangle.height) < epsilon; } RectangleF(float x, float y, float width, float height);  RectangleF(); boolean update(float x, float y, float w, float h); RectangleF copy(); Rectangle asIntRect(); RectangleF translateImmutable(RectangleF src, RectangleF dest); RectangleF translate(RectangleF src, RectangleF dest); RectangleF aspectRatioScale(RectangleF dest); RectangleF aspectRatioScaleImmutable(RectangleF dest); RectangleF scale(float scale); RectangleF scaleImmutable(float scale); RectangleF centerImmutable(RectangleF dest); RectangleF center(RectangleF dest); @Override String toString(); DimensionF getDimension(); @Override boolean equals(Object o); @Override int hashCode(); boolean update(RectangleF srcRect); boolean update(Rectangle srcRect); float getAR(); RectangleF position(int x, int y); RectangleF updateHeightUsingAspectRatio(float ar); RectangleF updateWidthUsingAspectRatio(float ar); public float x; public float y; public float width; public float height; }
@Test public void testEquals() { assertTrue(AspectHelper.RectF_16_9.equals(AspectHelper.RectF_16_9.copy())); assertFalse(AspectHelper.RectF_16_9.equals(AspectHelper.RectF_4_3)); }