#vulnerable code 
                             @Test
	public void testCache() throws Exception {
		BrowserManager browserManager = null;
		if (browserManagerClass.equals(ChromeDriverManager.class)) {
			browserManager = ChromeDriverManager.getInstance();
		} else if (browserManagerClass.equals(OperaDriverManager.class)) {
			browserManager = OperaDriverManager.getInstance();
		} else if (browserManagerClass.equals(PhantomJsDriverManager.class)) {
			browserManager = PhantomJsDriverManager.getInstance();
		} else if (browserManagerClass.equals(FirefoxDriverManager.class)) {
			browserManager = FirefoxDriverManager.getInstance();
		}

		browserManager.architecture(architecture).version(driverVersion)
				.setup();
		Downloader downloader = new Downloader(browserManager);

		Method method = BrowserManager.class.getDeclaredMethod(
				"existsDriverInCache", String.class, String.class,
				Architecture.class);
		method.setAccessible(true);
		String driverInChachePath = (String) method.invoke(browserManager,
				downloader.getTargetPath(), driverVersion, architecture);

		assertThat(driverInChachePath, notNullValue());
	} 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Test
	public void testCache() throws Exception {
		BrowserManager browserManager = WebDriverManager
				.getInstance(driverClass);
		browserManager.architecture(architecture).version(driverVersion)
				.setup();
		Downloader downloader = new Downloader(browserManager);

		Method method = BrowserManager.class.getDeclaredMethod(
				"existsDriverInCache", String.class, String.class,
				Architecture.class);
		method.setAccessible(true);
		String driverInChachePath = (String) method.invoke(browserManager,
				downloader.getTargetPath(), driverVersion, architecture);

		assertThat(driverInChachePath, notNullValue());
	}