VariablesEvent { @Override public int hashCode() { return Objects.hashCode(variables); } VariablesEvent(final List<Map<Variable, VariableTypedValue>> variables, final String error); static VariablesEvent from(final Map<String, Object> eventMap); List<Map<Variable, VariableTypedValue>> getVariables(); boolean hasError(); Optional<String> getError(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void hashCodeTests() { final List<Map<Variable, VariableTypedValue>> vars1 = newArrayList( ImmutableMap.of( new Variable("${a}", VariableScope.GLOBAL), new VariableTypedValue("int", 1), new Variable("@{b}", VariableScope.TEST_SUITE), new VariableTypedValue("list", newArrayList(4, 2)), new Variable("&{c}", VariableScope.LOCAL), new VariableTypedValue("dict", ImmutableMap.of("a", 4, "b", 2)))); final List<Map<Variable, VariableTypedValue>> vars2 = newArrayList( ImmutableMap.of( new Variable("${a}", VariableScope.GLOBAL), new VariableTypedValue("int", 1), new Variable("@{b}", VariableScope.TEST_SUITE), new VariableTypedValue("list", newArrayList(4, 2)), new Variable("&{c}", VariableScope.LOCAL), new VariableTypedValue("dict", ImmutableMap.of("a", 4, "b", 2)))); assertThat(new VariablesEvent(vars1, "error").hashCode()) .isEqualTo(new VariablesEvent(vars2, "error").hashCode()); }