@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); BooleanRequestBody sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); BooleanRequestBody differentObject = getTestObject(); differentObject.setFlag(true); assertFalse(getTestObject().equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } BooleanRequestBody that = (BooleanRequestBody) objectToCompare; return flag == that.flag; }
BooleanRequestBody implements Serializable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } BooleanRequestBody that = (BooleanRequestBody) objectToCompare; return flag == that.flag; } }
BooleanRequestBody implements Serializable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } BooleanRequestBody that = (BooleanRequestBody) objectToCompare; return flag == that.flag; } BooleanRequestBody();  BooleanRequestBody(BooleanRequestBody template); }
BooleanRequestBody implements Serializable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } BooleanRequestBody that = (BooleanRequestBody) objectToCompare; return flag == that.flag; } BooleanRequestBody();  BooleanRequestBody(BooleanRequestBody template); boolean isFlag(); void setFlag(boolean flag); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode(); }
BooleanRequestBody implements Serializable { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } BooleanRequestBody that = (BooleanRequestBody) objectToCompare; return flag == that.flag; } BooleanRequestBody();  BooleanRequestBody(BooleanRequestBody template); boolean isFlag(); void setFlag(boolean flag); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }