public static Optional<OP_TYPE> getOpTypeFromMiningFields(MiningSchema miningSchema, String fieldName) {
        if (miningSchema != null && miningSchema.getMiningFields() != null) {
            return miningSchema.getMiningFields().stream()
                    .filter(miningField -> Objects.equals(fieldName,miningField.getName()) && miningField.getOpType() != null)
                    .findFirst()
                    .map(dataField -> OP_TYPE.byName(dataField.getOpType().value()));
        } else {
            return Optional.empty();
        }
    }
@Test
    void getOpTypeFromMiningFields() {
        Optional<OP_TYPE> opType = org.kie.pmml.compiler.api.utils.ModelUtils.getOpTypeFromMiningFields(null, "vsd");
        assertThat(opType).isNotNull();
        assertThat(opType.isPresent()).isFalse();
        final MiningSchema miningSchema = new MiningSchema();
        opType = org.kie.pmml.compiler.api.utils.ModelUtils.getOpTypeFromMiningFields(miningSchema, "vsd");
        assertThat(opType).isNotNull();
        assertThat(opType.isPresent()).isFalse();
        IntStream.range(0, 3).forEach(i -> {
            final MiningField miningField = getRandomMiningField();
            miningSchema.addMiningFields(miningField);
        });
        miningSchema.getMiningFields().forEach(miningField -> {
            Optional<OP_TYPE> retrieved =
                    org.kie.pmml.compiler.api.utils.ModelUtils.getOpTypeFromMiningFields(miningSchema,miningField.getName());
            assertThat(retrieved).isNotNull();
            assertThat(retrieved).isPresent();
            OP_TYPE expected = OP_TYPE.byName(miningField.getOpType().value());
            assertThat(retrieved.get()).isEqualTo(expected);
        });
    }