CEPWindow implements HasParameterizedOperator { @Override public int hashCode() { int result = operator != null ? operator.hashCode() : 0; result = ~~result; result = 31 * result + (parameters != null ? parameters.hashCode() : 0); result = ~~result; return result; } CEPWindow(); void setOperator( String operator ); String getOperator(); void clearParameters(); String getParameter( String key ); void setParameter( String key,
                              String parameter ); void deleteParameter( String key ); Map<String, String> getParameters(); void setParameters( Map<String, String> parameters ); boolean isDefined(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void defaultValues() { final CEPWindow other = new CEPWindow(); assertNotNull(cepWindowDefaultValues.hashCode()); assertNotNull(other.hashCode()); assertEquals(cepWindowDefaultValues.hashCode(), other.hashCode()); }
@Test public void hashCodesShouldNotBeEqual() { assertNotEquals(cepWindowAllFieldsFilled.hashCode(), cepWindowDefaultValues.hashCode()); assertNotEquals(cepWindowAllFieldsFilled.hashCode(), cepWindowNullValues.hashCode()); assertNotEquals(cepWindowAllFieldsFilled.hashCode(), cepWindowNullParameters.hashCode()); assertNotEquals(cepWindowAllFieldsFilled.hashCode(), cepWindowNullOperator.hashCode()); assertEquals(cepWindowDefaultValues.hashCode(), cepWindowNullValues.hashCode()); assertNotEquals(cepWindowDefaultValues.hashCode(), cepWindowNullParameters.hashCode()); assertNotEquals(cepWindowDefaultValues.hashCode(), cepWindowNullOperator.hashCode()); assertNotEquals(cepWindowNullValues.hashCode(), cepWindowNullParameters.hashCode()); assertNotEquals(cepWindowNullValues.hashCode(), cepWindowNullOperator.hashCode()); assertNotEquals(cepWindowNullParameters.hashCode(), cepWindowNullOperator.hashCode()); }