public static NamenodeRole convert(NamenodeRoleProto role) {
    switch (role) {
    case NAMENODE:
      return NamenodeRole.NAMENODE;
    case BACKUP:
      return NamenodeRole.BACKUP;
    case CHECKPOINT:
      return NamenodeRole.CHECKPOINT;
    }
    return null;
  }
@Test
  public void testBlockChecksumTypeProto() {
    assertEquals(BlockChecksumType.MD5CRC,
        PBHelperClient.convert(HdfsProtos.BlockChecksumTypeProto.MD5CRC));
    assertEquals(BlockChecksumType.COMPOSITE_CRC,
        PBHelperClient.convert(
            HdfsProtos.BlockChecksumTypeProto.COMPOSITE_CRC));
    assertEquals(PBHelperClient.convert(BlockChecksumType.MD5CRC),
        HdfsProtos.BlockChecksumTypeProto.MD5CRC);
    assertEquals(PBHelperClient.convert(BlockChecksumType.COMPOSITE_CRC),
        HdfsProtos.BlockChecksumTypeProto.COMPOSITE_CRC);
  }