KijiCellRewriter extends KijiPivoter { public static <T, U> DecodedCell<T> convertAvro( DecodedCell<U> original, Schema schema ) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final Encoder encoder = EncoderFactory.get().directBinaryEncoder(baos, null); final DatumWriter<U> writer = new GenericDatumWriter<U>(original.getWriterSchema()); writer.write(original.getData(), encoder); encoder.flush(); final Decoder decoder = DecoderFactory.get().binaryDecoder(baos.toByteArray(), null); final DatumReader<T> reader = new GenericDatumReader<T>(original.getWriterSchema(), schema); final T data = reader.read(null, decoder); return new DecodedCell<T>(schema, data); }  @Override KijiDataRequest getDataRequest(); @Override void setup(KijiContext context); @Override void produce(final KijiRowData row, final KijiTableContext context); static DecodedCell<T> convertAvro(
      DecodedCell<U> original,
      Schema schema
  );  }
@Test public void testConvertAvro() throws Exception { final Schema intSchema = Schema.create(Schema.Type.INT); final Schema longSchema = Schema.create(Schema.Type.LONG); final DecodedCell<Object> original = new DecodedCell<Object>(intSchema, 1); Assert.assertEquals(1L, KijiCellRewriter.convertAvro(original, longSchema).getData()); }