public static CvssV3 vectorToCvssV3(String vectorString, Double baseScore) {
        if (!vectorString.startsWith("CVSS:3")) {
            throw new IllegalArgumentException("Not a valid CVSSv3 vector string: " + vectorString);
        }
        final String versionString = vectorString.substring(5, vectorString.indexOf('/'));
        final String[] metricStrings = vectorString.substring(vectorString.indexOf('/') + 1).split("/");
        final HashMap<String, String> metrics = new HashMap<>();
        for (int i = 0; i < metricStrings.length; i++) {
            final String[] metricKeyVal = metricStrings[i].split(":");
            if (metricKeyVal.length != 2) {
                throw new IllegalArgumentException(
                        String.format("Not a valid CVSSv3 vector string '%s', invalid metric component '%s'",
                                vectorString, metricStrings[i]));
            }
            metrics.put(metricKeyVal[0], metricKeyVal[1]);
        }
        if (!metrics.keySet().containsAll(BASE_METRICS_V3)) {
            throw new IllegalArgumentException(
                    String.format("Not a valid CVSSv3 vector string '%s'; missing one or more required Base Metrics;",
                            vectorString));
        }

        final CvssV3Data.Version version = CvssV3Data.Version.fromValue(versionString);
        //"CVSS:3.1\/AV:L\/AC:L\/PR:L\/UI:N\/S:U\/C:N\/I:N\/A:H"
        final CvssV3Data.AttackVectorType attackVector = CvssV3Data.AttackVectorType.fromValue(metrics.get("AV"));
        final CvssV3Data.AttackComplexityType attackComplexity = CvssV3Data.AttackComplexityType.fromValue(metrics.get("AC"));
        final CvssV3Data.PrivilegesRequiredType privilegesRequired = CvssV3Data.PrivilegesRequiredType.fromValue(metrics.get("PR"));
        final CvssV3Data.UserInteractionType userInteraction = CvssV3Data.UserInteractionType.fromValue(metrics.get("UI"));
        final CvssV3Data.ScopeType scope = CvssV3Data.ScopeType.fromValue(metrics.get("S"));
        final CvssV3Data.CiaType confidentialityImpact = CvssV3Data.CiaType.fromValue(metrics.get("C"));
        final CvssV3Data.CiaType integrityImpact = CvssV3Data.CiaType.fromValue(metrics.get("I"));
        final CvssV3Data.CiaType availabilityImpact = CvssV3Data.CiaType.fromValue(metrics.get("A"));

        final String baseSeverityString = Cvss3Severity.of(baseScore.floatValue()).name();
        final CvssV3Data.SeverityType baseSeverity = CvssV3Data.SeverityType.fromValue(baseSeverityString);
        final CvssV3Data data = new CvssV3Data(version, vectorString, attackVector, attackComplexity,
                privilegesRequired, userInteraction, scope, confidentialityImpact, integrityImpact, availabilityImpact, baseScore,
                baseSeverity, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
        final CvssV3 cvss = new CvssV3(null, null, data, null, null);
        return cvss;

    }
@Test
    public void testVectorToCvssV3() {
        String vectorString = "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H";
        Double baseScore = 10.0;
        CvssV3 result = CvssUtil.vectorToCvssV3(vectorString, baseScore);
        assertEquals(CvssV3Data.Version._3_1, result.getCvssData().getVersion());
        assertEquals(CvssV3Data.AttackVectorType.LOCAL, result.getCvssData().getAttackVector());
        assertEquals(CvssV3Data.AttackComplexityType.LOW, result.getCvssData().getAttackComplexity());
        assertEquals(CvssV3Data.PrivilegesRequiredType.LOW, result.getCvssData().getPrivilegesRequired());
        assertEquals(CvssV3Data.UserInteractionType.NONE, result.getCvssData().getUserInteraction());
        assertEquals(CvssV3Data.ScopeType.UNCHANGED, result.getCvssData().getScope());
        assertEquals(CvssV3Data.CiaType.NONE, result.getCvssData().getConfidentialityImpact());
        assertEquals(CvssV3Data.CiaType.NONE, result.getCvssData().getIntegrityImpact());
        assertEquals(CvssV3Data.CiaType.HIGH, result.getCvssData().getAvailabilityImpact());
        assertEquals(CvssV3Data.SeverityType.CRITICAL, result.getCvssData().getBaseSeverity());
        assertEquals(10.0, result.getCvssData().getBaseScore(), 0);
    }