@Test public void testEqualsNullParameter() { final String key = "KEY"; String params1 = "param1param2"; String params2 = "param1param2"; String params3 = "different"; ActionRequestImpl<String> null1 = new ActionRequestImpl<String>(key, null); ActionRequestImpl<String> null2 = new ActionRequestImpl<String>(key, null); ActionRequestImpl<String> nonNull1 = new ActionRequestImpl<String>(key, params1); ActionRequestImpl<String> nonNull2 = new ActionRequestImpl<String>(key, params2); ActionRequestImpl<String> different = new ActionRequestImpl<String>(key, params3); assertTrue("Null-null compare should be equal.", null1.equals(null2)); assertFalse("Null-non-null compare should be unequal.", null1.equals(nonNull2)); assertFalse("Non-null-null compare should be unequal.", nonNull1.equals(null2)); assertTrue("Non-null-non-null compare should be equal.", nonNull1.equals(nonNull2)); assertFalse("Non-null-non-null compare should be equal.", different.equals(nonNull1)); assertFalse("Non-null-non-null compare should be equal.", nonNull1.equals(different)); }
@SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); int getId(); void setId(final int inId); String getActionKey(); void setActionKey(final String inActionKey); Serializable getParam(); void setParam(final Serializable inParam); T getResponse(); void setResponse(final T inResponse); @SuppressWarnings("rawtypes") @Override boolean equals(final Object other); @Override int hashCode(); String getSessionId(); void setSessionId(final String inSessionId); }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); int getId(); void setId(final int inId); String getActionKey(); void setActionKey(final String inActionKey); Serializable getParam(); void setParam(final Serializable inParam); T getResponse(); void setResponse(final T inResponse); @SuppressWarnings("rawtypes") @Override boolean equals(final Object other); @Override int hashCode(); String getSessionId(); void setSessionId(final String inSessionId);  }