@Test public void testEquals() { Color theColor1 = new Color(1,2,3); Color theColor2 = new Color(1,2,3); assertTrue(theColor1.equals(theColor1)); assertTrue(theColor1.equals(theColor2)); assertFalse(theColor1.equals(Color.BLACK)); assertFalse(theColor1.equals(null)); assertFalse(theColor1.equals(1)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Color color = (Color) o; if (b != color.b) return false; if (g != color.g) return false; if (r != color.r) return false; return true; }
Color implements Reflectable<ColorClassInformation>, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Color color = (Color) o; if (b != color.b) return false; if (g != color.g) return false; if (r != color.r) return false; return true; } }
Color implements Reflectable<ColorClassInformation>, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Color color = (Color) o; if (b != color.b) return false; if (g != color.g) return false; if (r != color.r) return false; return true; } Color(int aR, int aG, int aB); }
Color implements Reflectable<ColorClassInformation>, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Color color = (Color) o; if (b != color.b) return false; if (g != color.g) return false; if (r != color.r) return false; return true; } Color(int aR, int aG, int aB); @Override boolean equals(Object o); @Override int hashCode(); @Override ColorClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Color deserialize(Map<String, Object> aSerializedData); }
Color implements Reflectable<ColorClassInformation>, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Color color = (Color) o; if (b != color.b) return false; if (g != color.g) return false; if (r != color.r) return false; return true; } Color(int aR, int aG, int aB); @Override boolean equals(Object o); @Override int hashCode(); @Override ColorClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Color deserialize(Map<String, Object> aSerializedData); static final Color WHITE; static final Color BLACK; static final Color RED; static final Color YELLOW; @ReflectiveField
    final int r; @ReflectiveField
    final int g; @ReflectiveField
    final int b; }