@Test
  public void testToString() {
    TableSplit split = new TableSplit(TableName.valueOf(name.getMethodName()),
      Bytes.toBytes("row-start"), Bytes.toBytes("row-end"), "location");
    String str = "Split(tablename=" + name.getMethodName() + ", startrow=row-start, "
      + "endrow=row-end, regionLocation=location, " + "regionname=)";
    Assert.assertEquals(str, split.toString());

    split =
      new TableSplit(TableName.valueOf(name.getMethodName()), null, Bytes.toBytes("row-start"),
        Bytes.toBytes("row-end"), "location", "encoded-region-name", 1000L);
    str = "Split(tablename=" + name.getMethodName() + ", startrow=row-start, "
      + "endrow=row-end, regionLocation=location, " + "regionname=encoded-region-name)";
    Assert.assertEquals(str, split.toString());

    split = new TableSplit(null, null, null, null);
    str = "Split(tablename=null, startrow=null, " + "endrow=null, regionLocation=null, "
      + "regionname=)";
    Assert.assertEquals(str, split.toString());

    split = new TableSplit(null, null, null, null, null, null, 1000L);
    str = "Split(tablename=null, startrow=null, " + "endrow=null, regionLocation=null, "
      + "regionname=null)";
    Assert.assertEquals(str, split.toString());
  }
Length of region need to be properly serialized.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableSplit.java