DiagnosticRequest implements Serializable { @Override public int hashCode() { int result = Objects.hash(serviceInterface, methodName); result = 31 * result + Arrays.deepHashCode(arguments); return result; } DiagnosticRequest(Class<?> serviceInterface, String methodName); @JsonCreator  DiagnosticRequest(@JsonProperty(value = "serviceInterface", required = true) Class<?> serviceInterface,
                           @JsonProperty(value = "methodName", required = true) String methodName,
                           @JsonProperty(value = "arguments") Object... arguments); Class<?> getServiceInterface(); String getMethodName(); @SuppressFBWarnings("EI_EXPOSE_REP") Object[] getArguments(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void test_hashCode_considers_everything() { DiagnosticRequest request1 = new DiagnosticRequest(Closeable.class, "run", 1, 2, 3); DiagnosticRequest request2 = new DiagnosticRequest(Closeable.class, "run", 1, 2, 3); DiagnosticRequest request3 = new DiagnosticRequest(Closeable.class, "run", 1, 2, 4); assertThat(request1.hashCode(), is(equalTo(request2.hashCode()))); assertThat(request1.hashCode(), is(not(equalTo(request3.hashCode())))); }