@Test public void testEqual() { ActionConstants actionConstant1 = null; ActionConstants actionConstant2 = null; RequestPolicy notActionConstants = null; assertTrue("Same null actionConstant should be equal", ActionConstantsUtils.equal(actionConstant1, actionConstant1)); assertTrue("Null actionConstants should be equal", ActionConstantsUtils.equal(actionConstant1, actionConstant2)); assertTrue("Null actionConstant and null object should be equal", ActionConstantsUtils.equal(actionConstant1, notActionConstants)); actionConstant1 = ActionConstants.READ; actionConstant2 = ActionConstants.WRITE; notActionConstants = new RequestPolicy(); assertFalse("Empty actionConstant and empty object should not be equal", ActionConstantsUtils.equal(actionConstant1, notActionConstants)); assertTrue("Same actionConstant should be equal", ActionConstantsUtils.equal(actionConstant1, actionConstant1)); assertFalse("Different actionConstants should be equal", ActionConstantsUtils.equal(actionConstant1, actionConstant2)); assertFalse("Different actionConstants should be equal (inverse)", ActionConstantsUtils.equal(actionConstant2, actionConstant1)); actionConstant2 = ActionConstants.READ; assertTrue("Equal actionConstants should be equal", ActionConstantsUtils.equal(actionConstant1, actionConstant2)); assertTrue("Equal actionConstants should be equal (inverse)", ActionConstantsUtils.equal(actionConstant2, actionConstant1)); }
public static boolean equal(ActionConstants o1, Object o2) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } ActionConstants ro2 = (ActionConstants) o2; return (o1.value().equals(ro2.value())); }
ActionConstantsUtils { public static boolean equal(ActionConstants o1, Object o2) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } ActionConstants ro2 = (ActionConstants) o2; return (o1.value().equals(ro2.value())); } }
ActionConstantsUtils { public static boolean equal(ActionConstants o1, Object o2) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } ActionConstants ro2 = (ActionConstants) o2; return (o1.value().equals(ro2.value())); }  }
ActionConstantsUtils { public static boolean equal(ActionConstants o1, Object o2) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } ActionConstants ro2 = (ActionConstants) o2; return (o1.value().equals(ro2.value())); }  static boolean equal(ActionConstants o1, Object o2); }
ActionConstantsUtils { public static boolean equal(ActionConstants o1, Object o2) { if (o1 == o2) { return true; } if (o2 == null) { return false; } if (o1 == null) { return false; } if (o1.getClass() != o2.getClass()) { return false; } ActionConstants ro2 = (ActionConstants) o2; return (o1.value().equals(ro2.value())); }  static boolean equal(ActionConstants o1, Object o2);  }