@Test
  public void testHashCode_length() {
    TableSplit split1 = new TableSplit(TableName.valueOf(name.getMethodName()),
      Bytes.toBytes("row-start"), Bytes.toBytes("row-end"), "location", 1984);
    TableSplit split2 = new TableSplit(TableName.valueOf(name.getMethodName()),
      Bytes.toBytes("row-start"), Bytes.toBytes("row-end"), "location", 1982);

    assertEquals(split1, split2);
    assertTrue(split1.hashCode() == split2.hashCode());
    HashSet<TableSplit> set = new HashSet<>(2);
    set.add(split1);
    set.add(split2);
    assertEquals(1, set.size());
  }
length of region should not influence hashcode
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSplit.java