public static PartitionStateData newPartitionStateData(int partition, int stateEpoch, long startOffset) {
        return new PartitionData(partition, stateEpoch, startOffset, DEFAULT_ERROR_CODE, DEFAULT_ERR_MESSAGE, DEFAULT_LEADER_EPOCH, null);
    }
This is a factory class for creating instances of {@link PartitionData}.
server-common/src/main/java/org/apache/kafka/server/group/share/PartitionFactory.java