@Override
  public int hashCode()
  {
    return new HashCodeBuilder()
      .append(_baseUriTemplate)
      .append(_pathKeys)
      .append(_id)
      .append(_queryParams)
      .toHashCode();
  }
@Test
  public void testEquality()
  {
    final GetRequest<?> equalRequest1 = Mockito.mock(GetRequest.class);
    Mockito.when(equalRequest1.getBaseUriTemplate()).thenReturn(BASE_URI_TEMPLATE);
    Mockito.when(equalRequest1.getPathKeys()).thenReturn(PATH_KEYS);
    Mockito.when(equalRequest1.getObjectId()).thenReturn(ID);
    Mockito.when(equalRequest1.getQueryParamsObjects()).thenReturn(QUERY_PARAMS_OBJECTS);

    final GetRequest<?> equalRequest2 = Mockito.mock(GetRequest.class);
    Mockito.when(equalRequest2.getBaseUriTemplate()).thenReturn(BASE_URI_TEMPLATE);
    Mockito.when(equalRequest2.getPathKeys()).thenReturn(PATH_KEYS);
    Mockito.when(equalRequest2.getObjectId()).thenReturn(ID);
    Mockito.when(equalRequest2.getQueryParamsObjects()).thenReturn(QUERY_PARAMS_OBJECTS);

    final GetRequest<?> idDifferRequest = Mockito.mock(GetRequest.class);
    Mockito.when(idDifferRequest.getBaseUriTemplate()).thenReturn(BASE_URI_TEMPLATE);
    Mockito.when(idDifferRequest.getPathKeys()).thenReturn(PATH_KEYS);
    Mockito.when(idDifferRequest.getObjectId()).thenReturn(null);
    Mockito.when(idDifferRequest.getQueryParamsObjects()).thenReturn(QUERY_PARAMS_OBJECTS);

    final RestliRequestUriSignature equalSignature1 = new RestliRequestUriSignature(equalRequest1, RestliRequestUriSignature.ALL_FIELDS);
    final RestliRequestUriSignature equalSignature2 = new RestliRequestUriSignature(equalRequest2, RestliRequestUriSignature.ALL_FIELDS);
    Assert.assertEquals(equalSignature1.hashCode(), equalSignature2.hashCode());
    Assert.assertEquals(equalSignature1, equalSignature2);

    final Set<SignatureField> nonIDFields = new HashSet<>(Arrays.asList(SignatureField.BASE_URI_TEMPLATE,
        SignatureField.PATH_KEYS,
        SignatureField.QUERY_PARAMS));
    final RestliRequestUriSignature equalSignature3 = new RestliRequestUriSignature(equalRequest1, nonIDFields);
    final RestliRequestUriSignature equalSignature4 = new RestliRequestUriSignature(idDifferRequest, RestliRequestUriSignature.ALL_FIELDS);
    Assert.assertEquals(equalSignature3.hashCode(), equalSignature4.hashCode());
    Assert.assertEquals(equalSignature3, equalSignature4);
  }