@Test
  public void testGetType() {
    ExtendedCell c = Mockito.mock(ExtendedCell.class);
    Mockito.when(c.getType()).thenCallRealMethod();
    for (Cell.Type type : Cell.Type.values()) {
      Mockito.when(c.getTypeByte()).thenReturn(type.getCode());
      assertEquals(type, c.getType());
    }

    try {
      Mockito.when(c.getTypeByte()).thenReturn(KeyValue.Type.Maximum.getCode());
      c.getType();
      fail("The code of Maximum can't be handled by Cell.Type");
    } catch (UnsupportedOperationException e) {
    }

    try {
      Mockito.when(c.getTypeByte()).thenReturn(KeyValue.Type.Minimum.getCode());
      c.getType();
      fail("The code of Maximum can't be handled by Cell.Type");
    } catch (UnsupportedOperationException e) {
    }
  }
Assert CellUtil makes Cell toStrings same way we do KeyValue toStrings.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestCellUtil.java