### Question:
ColorGradient { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + color1.hashCode(); result = prime * result + x1; result = prime * result + y1; result = prime * result + color2.hashCode(); result = prime * result + x2; result = prime * result + y2; return result; } ColorGradient(int x1, int y1, ColorRgba color1, int x2, int y2, ColorRgba color2); int getX1(); int getY1(); ColorRgba getColor1(); int getX2(); int getY2(); ColorRgba getColor2(); @Override int hashCode(); @Override boolean equals(Object object);  }### Answer:
@Test void testHashCode() { final ColorGradient color = new ColorGradient(0, 1, ColorRgba.BLACK, 2, 3, ColorRgba.WHITE); assertHashEquals(color, new ColorGradient(0, 1, ColorRgba.BLACK, 2, 3, ColorRgba.WHITE)); assertHashNotEquals(color, new Object()); assertHashNotEquals(color, new ColorGradient(1, 1, ColorRgba.BLACK, 2, 3, ColorRgba.WHITE)); assertHashNotEquals(color, new ColorGradient(0, 0, ColorRgba.BLACK, 2, 3, ColorRgba.WHITE)); assertHashNotEquals(color, new ColorGradient(0, 1, ColorRgba.WHITE, 2, 3, ColorRgba.WHITE)); assertHashNotEquals(color, new ColorGradient(0, 1, ColorRgba.BLACK, 0, 3, ColorRgba.WHITE)); assertHashNotEquals(color, new ColorGradient(0, 1, ColorRgba.BLACK, 2, 0, ColorRgba.WHITE)); assertHashNotEquals(color, new ColorGradient(0, 1, ColorRgba.BLACK, 2, 3, ColorRgba.BLACK)); }