@Test
  public void testToStringEqualsAndHashcode() {
    ByteRange byteRange = ByteRanges.fromLastNBytes(4);
    GetOption getOption = GetOption.None;
    GetBlobOptions.OperationType type = GetBlobOptions.OperationType.Data;
    GetBlobOptions a = new GetBlobOptionsBuilder().operationType(type).getOption(getOption).range(byteRange).build();
    GetBlobOptions b = new GetBlobOptionsBuilder().operationType(type).getOption(getOption).range(byteRange).build();
    assertEquals("GetBlobOptions should be equal", a, b);
    assertEquals("GetBlobOptions hashcodes should be equal", a.hashCode(), b.hashCode());
    assertEquals("GetBlobOptions toString should be equal", a.toString(), b.toString());

    // Change OperationType
    b = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All)
        .getOption(getOption)
        .range(byteRange)
        .build();
    assertOptionsAreDistinct(a, b);

    // Change GetOption
    b = new GetBlobOptionsBuilder().operationType(type).getOption(GetOption.Include_All).range(byteRange).build();
    assertOptionsAreDistinct(a, b);

    // Change range
    b = new GetBlobOptionsBuilder().operationType(type)
        .getOption(getOption)
        .range(ByteRanges.fromOffsetRange(2, 7))
        .build();
    assertOptionsAreDistinct(a, b);

    // Change rawMode (need to omit range)
    a = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All).getOption(getOption).build();
    b = new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All)
        .getOption(getOption)
        .rawMode(true)
        .build();
    assertOptionsAreDistinct(a, b);
  }
Test toString, equals, and hashCode methods.
ambry-api/src/test/java/com/github/ambry/router/GetBlobOptionsTest.java