public static KiePMMLMiningField getKiePMMLMiningField(final MiningField toConvert, final Field<?> field) {
        String name = toConvert.getName() != null ?toConvert.getName() : "" + toConvert.hashCode();
        final FIELD_USAGE_TYPE fieldUsageType = toConvert.getUsageType() != null ?
                FIELD_USAGE_TYPE.byName(toConvert.getUsageType().value()) : null;
        final OP_TYPE opType = toConvert.getOpType() != null ? OP_TYPE.byName(toConvert.getOpType().value()) : null;
        final DATA_TYPE dataType = field.getDataType() != null ?
                DATA_TYPE.byName(field.getDataType().value()) : null;
        final MISSING_VALUE_TREATMENT_METHOD missingValueTreatmentMethod =
                toConvert.getMissingValueTreatment() != null ?
                        MISSING_VALUE_TREATMENT_METHOD.byName(toConvert.getMissingValueTreatment().value()) : null;
        final INVALID_VALUE_TREATMENT_METHOD invalidValueTreatmentMethod =
                toConvert.getInvalidValueTreatment() != null ?
                        INVALID_VALUE_TREATMENT_METHOD.byName(toConvert.getInvalidValueTreatment().value()) : null;
        final String missingValueReplacement = toConvert.getMissingValueReplacement() != null ?
                toConvert.getMissingValueReplacement().toString() : null;
        final String invalidValueReplacement = toConvert.getInvalidValueReplacement() != null ?
                toConvert.getInvalidValueReplacement().toString() : null;
        final List<String> allowedValues = field instanceof DataField ?
                convertDataFieldValues(((DataField) field).getValues()) : Collections.emptyList();
        final List<KiePMMLInterval> intervals = field instanceof DataField ?
                getKiePMMLIntervals(((DataField) field).getIntervals()) :
                Collections.emptyList();

        final KiePMMLMiningField.Builder builder = KiePMMLMiningField.builder(name, Collections.emptyList())
                .withFieldUsageType(fieldUsageType)
                .withOpType(opType)
                .withDataType(dataType)
                .withMissingValueTreatmentMethod(missingValueTreatmentMethod)
                .withInvalidValueTreatmentMethod(invalidValueTreatmentMethod)
                .withMissingValueReplacement(missingValueReplacement)
                .withInvalidValueReplacement(invalidValueReplacement)
                .withAllowedValues(allowedValues)
                .withIntervals(intervals);
        return builder.build();
    }
@Test
    void getKiePMMLMiningField() {
        DataField dataField = getRandomDataField();
        MiningField toConvert = getRandomMiningField(dataField);
        KiePMMLMiningField toVerify = KiePMMLMiningFieldInstanceFactory.getKiePMMLMiningField(toConvert, dataField);
        commonVerifyKiePMMLMiningField(toVerify, toConvert, dataField);
    }