#vulnerable code 
                                public void testRepoSaveDelete() {
        this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
        RepoResult result = this.repo.getRepoByName("myname");

        assertThat(result.getName()).isEqualTo("myname");
        assertThat(result.getScm()).isEqualTo("git");
        assertThat(result.getUrl()).isEqualTo("myurl");
        assertThat(result.getUsername()).isEqualTo("username");
        assertThat(result.getPassword()).isEqualTo("password");
        assertThat(result.getSource()).isEqualTo("mysource");
        assertThat(result.getBranch()).isEqualTo("mybranch");
        assertThat(result.getData().averageIndexTimeSeconds).isEqualTo(0);

        this.repo.deleteRepoByName("myname");

        result = this.repo.getRepoByName("myname");
        assertThat(result).isNull();
    } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public void testRepoSaveDelete() {
        this.repo.saveRepo(new RepoResult(-1, "myname", "git", "myurl", "username", "password", "mysource", "mybranch", "{}"));
        Optional<RepoResult> repoResult = this.repo.getRepoByName("myname");
        RepoResult result = repoResult.get();


        assertThat(result.getName()).isEqualTo("myname");
        assertThat(result.getScm()).isEqualTo("git");
        assertThat(result.getUrl()).isEqualTo("myurl");
        assertThat(result.getUsername()).isEqualTo("username");
        assertThat(result.getPassword()).isEqualTo("password");
        assertThat(result.getSource()).isEqualTo("mysource");
        assertThat(result.getBranch()).isEqualTo("mybranch");
        assertThat(result.getData().averageIndexTimeSeconds).isEqualTo(0);

        this.repo.deleteRepoByName("myname");

        Optional<RepoResult> repoResult2 = this.repo.getRepoByName("myname");
        assertThat(repoResult2.isPresent()).isFalse();
    }