public static ClusterDataSetListResponseBody from(
            Map<IntermediateDataSetID, DataSetMetaInfo> dataSets) {
        final List<ClusterDataSetEntry> convertedInfo =
                dataSets.entrySet().stream()
                        .map(
                                entry -> {
                                    DataSetMetaInfo metaInfo = entry.getValue();
                                    int numRegisteredPartitions =
                                            metaInfo.getNumRegisteredPartitions().orElse(0);
                                    int numTotalPartition = metaInfo.getNumTotalPartitions();
                                    return new ClusterDataSetEntry(
                                            entry.getKey(),
                                            numRegisteredPartitions == numTotalPartition);
                                })
                        .collect(Collectors.toList());
        return new ClusterDataSetListResponseBody(convertedInfo);
    }
@Test
    void testFrom() {
        final Map<IntermediateDataSetID, DataSetMetaInfo> originalDataSets = new HashMap<>();
        originalDataSets.put(
                new IntermediateDataSetID(), DataSetMetaInfo.withNumRegisteredPartitions(1, 2));
        originalDataSets.put(
                new IntermediateDataSetID(), DataSetMetaInfo.withNumRegisteredPartitions(2, 2));

        List<ClusterDataSetEntry> convertedDataSets =
                ClusterDataSetListResponseBody.from(originalDataSets).getDataSets();
        assertThat(convertedDataSets).hasSize(2);
        for (ClusterDataSetEntry convertedDataSet : convertedDataSets) {
            IntermediateDataSetID id =
                    new IntermediateDataSetID(
                            new AbstractID(
                                    StringUtils.hexStringToByte(convertedDataSet.getDataSetId())));

            DataSetMetaInfo dataSetMetaInfo = originalDataSets.get(id);

            assertThat(convertedDataSet.isComplete())
                    .isEqualTo(
                            dataSetMetaInfo.getNumRegisteredPartitions().orElse(0)
                                    == dataSetMetaInfo.getNumTotalPartitions());
        }
    }