@Test
  public void serdesTVPairsTest() {
    List<List<TimeValuePair>> TVPairs = new ArrayList<>();
    TimeValuePair p1 = new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.BOOLEAN, true));
    TVPairs.add(Collections.singletonList(p1));
    TimeValuePair p2 = new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.INT32, 1));
    TVPairs.add(Collections.singletonList(p2));
    TimeValuePair p3 = new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.INT64, 1L));
    TVPairs.add(Collections.singletonList(p3));
    TimeValuePair p4 = new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.FLOAT, 1.0f));
    TVPairs.add(Collections.singletonList(p4));
    TimeValuePair p5 = new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.DOUBLE, 1.0d));
    TVPairs.add(Collections.singletonList(p5));
    TimeValuePair p6 =
        new TimeValuePair(0, TsPrimitiveType.getByType(TSDataType.TEXT, BytesUtils.valueOf("a")));
    TVPairs.add(Collections.singletonList(p6));

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream outputStream = new DataOutputStream(baos);
    for (List<TimeValuePair> tv : TVPairs) {
      SerializeUtils.serializeTVPairs(tv, outputStream);
      ByteBuffer buffer = ByteBuffer.wrap(baos.toByteArray());
      Assert.assertEquals(tv, SerializeUtils.deserializeTVPairs(buffer));
      baos.reset();
    }
  }
This method tests SerializeUtils.serializeTVPairs() and SerializeUtils.deserializeTVPairs()
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/SerializeUtilsTest.java