public static CvssV2 vectorToCvssV2(String vectorString, Double baseScore) {
        if (vectorString.startsWith("CVSS:")) {
            throw new IllegalArgumentException("Not a valid CVSSv2 vector string: " + vectorString);
        }
        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 CVSSv2 vector string '%s', invalid metric component '%s'",
                                vectorString, metricStrings[i]));
            }
            metrics.put(metricKeyVal[0], metricKeyVal[1]);
        }
        if (!metrics.keySet().containsAll(BASE_METRICS_V2)) {
            throw new IllegalArgumentException(
                    String.format("Not a valid CVSSv2 vector string '%s'; missing one or more required Metrics;",
                            vectorString));
        }

        final String version = CvssV2Data.Version._2_0.value();
        //"AV:L/AC:L/Au:N/C:N/I:N/A:C"
        final CvssV2Data.AccessVectorType accessVector = CvssV2Data.AccessVectorType.fromValue(metrics.get("AV"));
        final CvssV2Data.AccessComplexityType attackComplexity = CvssV2Data.AccessComplexityType.fromValue(metrics.get("AC"));
        final CvssV2Data.AuthenticationType authentication = CvssV2Data.AuthenticationType.fromValue(metrics.get("Au"));
        final CvssV2Data.CiaType confidentialityImpact = CvssV2Data.CiaType.fromValue(metrics.get("C"));
        final CvssV2Data.CiaType integrityImpact = CvssV2Data.CiaType.fromValue(metrics.get("I"));
        final CvssV2Data.CiaType availabilityImpact = CvssV2Data.CiaType.fromValue(metrics.get("A"));

        final String baseSeverity = cvssV2ScoreToSeverity(baseScore);
        final CvssV2Data data = new CvssV2Data(version, vectorString, accessVector, attackComplexity,
                authentication, confidentialityImpact, integrityImpact, availabilityImpact, baseScore, baseSeverity,
                null, null, null, null, null, null, null, null, null, null);
        final CvssV2 cvss = new CvssV2(null, null, data, baseSeverity, null, null, null, null, null, null, null);
        return cvss;

    }
@Test
    public void testVectorToCvssV2() {
        String vectorString = "/AV:L/AC:L/Au:N/C:N/I:N/A:C";
        Double baseScore = 1.0;
        CvssV2 result = CvssUtil.vectorToCvssV2(vectorString, baseScore);
        assertEquals(CvssV2Data.Version._2_0, result.getCvssData().getVersion());
        assertEquals(CvssV2Data.AccessVectorType.LOCAL, result.getCvssData().getAccessVector());
        assertEquals(CvssV2Data.AccessComplexityType.LOW, result.getCvssData().getAccessComplexity());
        assertEquals(CvssV2Data.AuthenticationType.NONE, result.getCvssData().getAuthentication());
        assertEquals(CvssV2Data.CiaType.NONE, result.getCvssData().getConfidentialityImpact());
        assertEquals(CvssV2Data.CiaType.NONE, result.getCvssData().getIntegrityImpact());
        assertEquals(CvssV2Data.CiaType.COMPLETE, result.getCvssData().getAvailabilityImpact());
        assertEquals("LOW", result.getCvssData().getBaseSeverity());
        assertEquals(1.0, result.getCvssData().getBaseScore(), 0);
    }