    public void insertProjectInfo(Map<String, Object> map) {
        try (SqlSession session = factory.openSession()) {
            session.insert(mapperName + "insertProjectInfo", map);
            session.commit();
        }
    }

    public void insertProjectInfo(Map<String, Object> map){
        SqlSession session = factory.openSession();
        try {
            session.insert(mapperName + "insertProjectInfo", map);
            session.commit();
        } finally {
            session.close();
        }
    }

Try With Resources try(SqlSession session=factory.openSession()) in method public insertProjectInfo(map Map<String,Object>) : void from class com.seculayer.mrms.db.ProjectManageDAO


    private static List<Class<?>> scan(String packageName){
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        String path = packageName.replace('.', '/');

        List<Class<?>> classes = new ArrayList<>();
        try {
            Enumeration<URL> resources = classLoader.getResources(path);
            URL res = resources.nextElement();

            for (File file : Objects.requireNonNull(new File(res.getFile()).listFiles())) {
                if (file.getName().endsWith(".class")) {
                    String className = packageName + '.' + file.getName().substring(0, file.getName().length() - 6);
                    classes.add(classLoader.loadClass(className));
                }
            }
        } catch (Exception e){
            e.printStackTrace();
        }

        return classes;
    }

    private static List<Class<?>> scan(String packageName){
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        String path = packageName.replace('.', '/');

        List<Class<?>> classes = new ArrayList<Class<?>>();
        try {
            Enumeration<URL> resources = classLoader.getResources(path);
            URL res = resources.nextElement();

            for (File file : Objects.requireNonNull(new File(res.getFile()).listFiles())) {
                if (file.getName().endsWith(".class")) {
                    String className = packageName + '.' + file.getName().substring(0, file.getName().length() - 6);
                    classes.add(classLoader.loadClass(className));
                }
            }
        } catch (Exception e){
            e.printStackTrace();
        }

        return classes;
    }

Replace Generic With Diamond ArrayList<Class<?>> with ArrayList<> in method private scan(packageName String) : List<Class<?>> from class com.seculayer.mrms.rest.ServletFactory


    public BookParser() {

        ObjectMapper objectMapper = new ObjectMapper();
        try {
            File file = new File("baza.json");
            ExternalBook.externalBooks = objectMapper.readValue(file, new TypeReference<>() {
            });

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public BookParser() {

        ObjectMapper objectMapper = new ObjectMapper();
        try {
            File file = new File("baza.json");
            Book.books = objectMapper.readValue(file, new TypeReference<List<Book>>() {
            });

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

Replace Generic With Diamond TypeReference<List<Book>> with TypeReference<> in method public BookParser() from class com.infoshareacademy.BookParser


    public static ArrayList<City> CityStandard(String select){
        //Stores the Cities relevant to the input SQL statement
        ArrayList<City> Cities = new ArrayList<>();

        try {
            //Creates the statement as an SQL statement.
            Statement stmt = Database.con.createStatement();
            ResultSet rset = stmt.executeQuery(select);
            //Executes the query to return all values to be stored.

            //Creates a new city and stores the relevant values before adding it to the ArrayList.
            while (rset.next()) {
                City city = new City();
                city.setName(rset.getString("city.Name"));
                city.setCountryCode(rset.getString("city.CountryCode"));
                //Need to store Country but can only access via CountryCode
                city.setDistrict(rset.getString("city.District"));
                city.setPopulation(rset.getInt("city.Population"));

                Cities.add(city);
            }
        } catch (SQLException e) {
            //Bypasses problems created by IntelliJ not thinking it's been integrated with SQL.
            throw new RuntimeException(e);
        }

        return Cities;
    }

    public static ArrayList<City> CityStandard(String select){
        //Stores the Cities relevant to the input SQL statement
        ArrayList<City> Cities = new ArrayList<City>();

        try {
            //Creates the statement as an SQL statement.
            Statement stmt = Database.con.createStatement();
            ResultSet rset = stmt.executeQuery(select);
            //Executes the query to return all values to be stored.

            //Creates a new city and stores the relevant values before adding it to the ArrayList.
            while (rset.next()) {
                City city = new City();
                city.setName(rset.getString("city.Name"));
                city.setCountryCode(rset.getString("city.CountryCode"));
                //Need to store Country but can only access via CountryCode
                city.setDistrict(rset.getString("city.District"));
                city.setPopulation(rset.getInt("city.Population"));

                Cities.add(city);
            }
        } catch (SQLException e) {
            //Bypasses problems created by IntelliJ not thinking it's been integrated with SQL.
            throw new RuntimeException(e);
        }

        return Cities;
    }

Replace Generic With Diamond ArrayList<City> with ArrayList<> in method public CityStandard(select String) : ArrayList<City> from class com.napier.Ambry.CityReports


/**
   * Try to complete the pull operation before to create a new branch.
   *

   * If the pull success, the user will be asked to create a new branch.
   *

   * If the pull fails, the process will be aborted.
   *
   * @param dialogTitle          The title of the create branch dialog.
   * @param nameToPropose        The name to propose for the new branch to be created.
   * @param isCheckoutRemote     true if the checkout branch is a remote branch.
   * @param branchCreator        The branch creator after the user confirmation.
   */
  private void tryPull(String dialogTitle,
      String nameToPropose,
      boolean isCheckoutRemote,
      IBranchesCreator branchCreator) {

    shouldShowPullDialog.set(true);

    if(pullListener == null) {
      pullListener = createGitPullListener(dialogTitle, nameToPropose, isCheckoutRemote, branchCreator);
      ctrl.addGitListener(pullListener);
    }

    SwingUtilities.invokeLater(() -> {
      pullOperationProgressDialog.initUI();
      pullOperationProgressDialog.setCancelListener(new OnDialogCancel() {
        @Override
        public void doOnCancel() {
          SwingUtilities.invokeLater(() -> pullOperationProgressDialog.setVisible(false));
        }
      });
      pullOperationProgressDialog.show(0);
    });

    ctrl.pull(
        OptionsManager.getInstance().getDefaultPullType() == PullType.REBASE ? PullType.REBASE : PullType.MERGE_FF,
        new GitOperationProgressMonitor(pullOperationProgressDialog));
  }

/**
   * Try to complete the pull operation before to create a new branch.
   *

   * If the pull success, the user will be asked to create a new branch.
   *

   * If the pull fails, the process will be aborted.
   *
   * @param dialogTitle          The title of the create branch dialog.
   * @param nameToPropose        The name to propose for the new branch to be created.
   * @param isCheckoutRemote     true if the checkout branch is a remote branch.
   * @param branchCreator        The branch creator after the user confirmation.
   */
  private void tryPull(String dialogTitle,
      String nameToPropose,
      boolean isCheckoutRemote,
      IBranchesCreator branchCreator) {

    shouldShowPullDialog.set(true);

    SwingUtilities.invokeLater(() -> {
      pullOperationProgressDialog.initUI();
      pullOperationProgressDialog.show(0);
    });

    if(pullListener == null) {
      pullListener = createGitPullListener(dialogTitle, nameToPropose, isCheckoutRemote, branchCreator);
      ctrl.addGitListener(pullListener);
    }

    pullOperationProgressDialog.setCancelListener(new OnDialogCancel() {
      @Override
      public void doOnCancel() {
        SwingUtilities.invokeLater(() -> pullOperationProgressDialog.setVisible(false));
      }
    });

    ctrl.pull(
        OptionsManager.getInstance().getDefaultPullType() == PullType.REBASE ? PullType.REBASE : PullType.MERGE_FF,
        new GitOperationProgressMonitor(pullOperationProgressDialog));
  }

Replace Anonymous With Lambda com.oxygenxml.git.view.branches.BranchCheckoutMediator.tryPull.setCancelListener.new OnDialogCancel with () -> {pullOperationProgressDialog.initUI(); in method private tryPull(dialogTitle String, nameToPropose String, isCheckoutRemote boolean, branchCreator IBranchesCreator) : void from class com.oxygenxml.git.view.branches.BranchCheckoutMediator


        @Override
        public void actionPerformed(ActionEvent e) {
          int selectedRow = remotesTable.getSelectedRow();
          if(selectedRow >= 0) {
            final String remoteName = (String)remotesModel.getValueAt(selectedRow,
                RemotesTableModel.REMOTE_COLUMN);
            final int answer = MessagePresenterProvider.getBuilder(
                TRANSLATOR.getTranslation(Tags.DELETE_REMOTE), DialogType.WARNING)
                .setQuestionMessage(MessageFormat.format(
                    TRANSLATOR.getTranslation(Tags.DELETE_REMOTE_CONFIRMATION_MESSAGE),
                    remoteName))
                .setOkButtonName(TRANSLATOR.getTranslation(Tags.YES))
                .setCancelButtonName(TRANSLATOR.getTranslation(Tags.NO))
                .buildAndShow().getResult();

            if (OKCancelDialog.RESULT_OK == answer) {

              actionsToExecute.add(() -> {
                try {
                  GitAccess.getInstance().removeRemote(remoteName);
                } catch (NoRepositorySelected e1) {
                  LOGGER.error(e1.getMessage(), e1);
                }
              });

              remotesModel.deleteRemote(selectedRow);
            }
          }
        }

        @Override
        public void actionPerformed(ActionEvent e) {
          int selectedRow = remotesTable.getSelectedRow();
          if(selectedRow >= 0) {
            final String remoteName = (String)remotesModel.getValueAt(selectedRow,
                RemotesTableModel.REMOTE_COLUMN);
            final int answer = MessagePresenterProvider.getBuilder(
                TRANSLATOR.getTranslation(Tags.DELETE_REMOTE), DialogType.WARNING)
                .setQuestionMessage(MessageFormat.format(
                    TRANSLATOR.getTranslation(Tags.DELETE_REMOTE_CONFIRMATION_MESSAGE),
                    remoteName))
                .setOkButtonName(TRANSLATOR.getTranslation(Tags.YES))
                .setCancelButtonName(TRANSLATOR.getTranslation(Tags.NO))
                .buildAndShow().getResult();

            if (OKCancelDialog.RESULT_OK == answer) {

              actionsToExecute.add(new Runnable() {

                @Override
                public void run() {
                  try {
                    GitAccess.getInstance().removeRemote(remoteName);
                  } catch (NoRepositorySelected e1) {
                    LOGGER.error(e1.getMessage(), e1);
                  }

                }
              });

              remotesModel.deleteRemote(selectedRow);
            }
          }
        }

Replace Anonymous With Lambda com.oxygenxml.git.view.remotes.RemotesRepositoryDialog.UIComponentsFactory.createDeleteButton.new Button.new AbstractAction.actionPerformed.add.new Runnable with () -> {tryGitAccess.getInstance().removeRemote(remoteName); in method public actionPerformed(e ActionEvent) : void from class com.oxygenxml.git.view.remotes.RemotesRepositoryDialog.UIComponentsFactory.createDeleteButton.new Button.new AbstractAction


/**
   * Merge the given branch into the current branch.
   *
   * @param branchName    The full name of the branch to be merged into the current one(e.g. refs/heads/dev).
   * @param isSquashMerge true if is a squash commit.
   *
   * @throws IOException
   * @throws NoRepositorySelected
   * @throws GitAPIException
   */
  private void internalMerge(final String branchName, boolean isSquash)
      throws IOException, NoRepositorySelected, GitAPIException {
    fireOperationAboutToStart(new BranchGitEventInfo(GitOperation.MERGE, branchName));
    try {
      final ObjectId mergeBase = getRepository().resolve(branchName);
      final MergeCommand mergeCommand = git.merge().include(mergeBase);
      if(isSquash) {
        mergeCommand.setStrategy(MergeStrategy.RESOLVE).setSquash(isSquash).setCommit(true);
      }

      final MergeResult res = mergeCommand.call();
      if (res.getMergeStatus().equals(MergeResult.MergeStatus.CONFLICTING)) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("We have conflicts here: {}", res.getConflicts());
        }
        final List<String> conflictingFiles = new ArrayList<>(res.getConflicts().keySet());
        FileStatusDialog.showWarningMessage(
            TRANSLATOR.getTranslation(Tags.MERGE_CONFLICTS_TITLE),
            conflictingFiles,
            TRANSLATOR.getTranslation(Tags.MERGE_CONFLICTS_MESSAGE));
      } else if (res.getMergeStatus().equals(MergeResult.MergeStatus.FAILED)) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("Failed because of this files: {}", res.getFailingPaths());
        }
        final List<String> failingFiles = new ArrayList<>(res.getFailingPaths().keySet());
        FileStatusDialog.showErrorMessage(
            TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_TITLE),
            failingFiles,
            TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_MESSAGE));
      }

      if(isSquash) {
        final String squashMessage = getRepository().readSquashCommitMsg();
        commit(squashMessage != null? squashMessage : "");
      }

      fireOperationSuccessfullyEnded(new BranchGitEventInfo(GitOperation.MERGE, branchName));

    } catch (CheckoutConflictException | RevisionSyntaxException | IOException | NoRepositorySelected e) {
      fireOperationFailed(new BranchGitEventInfo(GitOperation.MERGE, branchName), e);
      throw e;
    }

  }

/**
   * Merge the given branch into the current branch.
   *
   * @param branchName    The full name of the branch to be merged into the current one(e.g. refs/heads/dev).
   * @param isSquashMerge true if is a squash commit.
   *
   * @throws IOException
   * @throws NoRepositorySelected
   * @throws GitAPIException
   */
  private void internalMerge(final String branchName, boolean isSquash)
      throws IOException, NoRepositorySelected, GitAPIException {
    fireOperationAboutToStart(new BranchGitEventInfo(GitOperation.MERGE, branchName));
    try {
      final ObjectId mergeBase = getRepository().resolve(branchName);
      final MergeCommand mergeCommand = git.merge().include(mergeBase);
      if(isSquash) {
        mergeCommand.setStrategy(MergeStrategy.RESOLVE).setSquash(isSquash).setCommit(true);
      }

      final MergeResult res = mergeCommand.call();
      if (res.getMergeStatus().equals(MergeResult.MergeStatus.CONFLICTING)) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("We have conflicts here: {}", res.getConflicts());
        }
        final List<String> conflictingFiles = new ArrayList<>(res.getConflicts().keySet());
        FileStatusDialog.showWarningMessage(
            TRANSLATOR.getTranslation(Tags.MERGE_CONFLICTS_TITLE),
            conflictingFiles,
            TRANSLATOR.getTranslation(Tags.MERGE_CONFLICTS_MESSAGE));
      } else if (res.getMergeStatus().equals(MergeResult.MergeStatus.FAILED)) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("Failed because of this files: {}", res.getFailingPaths());
        }
        final List<String> failingFiles = new ArrayList<>(res.getFailingPaths().keySet());
        FileStatusDialog.showErrorMessage(
            TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_TITLE),
            failingFiles,
            TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_MESSAGE));
      }

      if(isSquash) {
        final String squashMessage = getRepository().readSquashCommitMsg();
        commit(squashMessage != null? squashMessage : "");
      }

      fireOperationSuccessfullyEnded(new BranchGitEventInfo(GitOperation.MERGE, branchName));

    } catch (RevisionSyntaxException | IOException | NoRepositorySelected e) {
      fireOperationFailed(new BranchGitEventInfo(GitOperation.MERGE, branchName), e);
      throw e;
    } catch (CheckoutConflictException e) {
      fireOperationFailed(new BranchGitEventInfo(GitOperation.MERGE, branchName), e);
      FileStatusDialog.showWarningMessage(
        TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_TITLE),
        e.getConflictingPaths(),
        TRANSLATOR.getTranslation(Tags.MERGE_FAILED_UNCOMMITTED_CHANGES_MESSAGE));
    }

  }

Merge Catch [catch(RevisionSyntaxException|IOException|NoRepositorySelected e), catch(CheckoutConflictException e)] to catch(CheckoutConflictException|RevisionSyntaxException|IOException|NoRepositorySelected e) in method private internalMerge(branchName String, isSquash boolean) : void from class com.oxygenxml.git.service.GitAccess


/**
   *
Description: tests the com.oxygenxml.git.service.GitAccess.createStash() API.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testCreateMethod() throws Exception {
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("modify");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());
    assertTrue(isStashEmpty());
    assertEquals("stash_description", gitAccess.createStash(false,"stash_description").getFullMessage());
    assertFalse(isStashEmpty());
    assertEquals(1, gitAccess.listStashes().size());
    gitAccess.dropStash(0);
    assertTrue(isStashEmpty());
  }

/**
   *
Description: tests the com.oxygenxml.git.service.GitAccess.createStash() API.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testCreateMethod() throws Exception {
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("modify");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());
    assertTrue(isStashEmpty());
    assertEquals("stash_description", gitAccess.createStash(false,"stash_description").getFullMessage());
    assertFalse(isStashEmpty());
    assertEquals(1, gitAccess.listStashes().size());
    gitAccess.dropStash(0);
    assertTrue(isStashEmpty());
  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testCreateMethod() : void from class com.oxygenxml.git.service.GitAccessStashTest


/**
   *
Description: tests the com.oxygenxml.git.service.GitAccess.stashApply(String stashRef) API.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testApplyMethod() throws Exception {
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("modify");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit commitStash = gitAccess.createStash(false, null);
    assertFalse(isStashEmpty());

    boolean noCommitFound = false;
    try {
      gitAccess.applyStash("No exists.");
    } catch (Exception e) {
      noCommitFound = true;
    }
    assertTrue(noCommitFound);

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("", content);

    gitAccess.applyStash(commitStash.getName());
    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

/**
   *
Description: tests the com.oxygenxml.git.service.GitAccess.stashApply(String stashRef) API.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testApplyMethod() throws Exception {
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("modify");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit commitStash = gitAccess.createStash(false, null);
    assertFalse(isStashEmpty());

    boolean noCommitFound = false;
    try {
      gitAccess.applyStash("No exists.");
    } catch (Exception e) {
      noCommitFound = true;
    }
    assertTrue(noCommitFound);

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("", content);

    gitAccess.applyStash(commitStash.getName());
    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testApplyMethod() : void from class com.oxygenxml.git.service.GitAccessStashTest


/**
   *
Description: tests the situation in which we want to apply a stash and we have uncommitted changes that do not cause conflicts.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashWithUncommittedChangesWithoutConflicts() throws Exception {
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("test");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit ref = gitAccess.createStash(false, null);
    assertFalse(isStashEmpty());

    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test2.txt")) {
      out.println("modify");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    gitAccess.applyStash(ref.getName());
    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("test", content);

    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test2.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

/**
   *
Description: tests the situation in which we want to apply a stash and we have uncommitted changes that do not cause conflicts.

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashWithUncommittedChangesWithoutConflicts() throws Exception {
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("test");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit ref = gitAccess.createStash(false, null);
    assertFalse(isStashEmpty());

    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test2.txt");
      out.println("modify");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }

    gitAccess.applyStash(ref.getName());
    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("test", content);

    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test2.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testStashWithUncommittedChangesWithoutConflicts() : void from class com.oxygenxml.git.service.GitAccessStashTest


	/**
	 * Adds a state change listener on the working copy selector combo box. When a
	 * new working copy is selected this listener will execute
	 */
	private void addWorkingCopySelectorListener() {
		// NOSONAR
		workingCopyCombo.addItemListener(
						e -> {
							// Don't do anything if the event was originated by us.
							if (!inhibitRepoUpdate && e.getStateChange() == ItemEvent.SELECTED) {
								inhibitRepoUpdate = true;
								try {
									// get and save the selected Option so that at restart the same
									// repository will be selected
									String selectedEntry = (String) workingCopyCombo.getSelectedItem();
									LOGGER.debug("Selected working copy: " + selectedEntry);
									if (CLEAR_HISTORY_ENTRY.equals(selectedEntry)) {
										SwingUtilities.invokeLater(() -> {
											String[] options = new String[] {
													"   " + TRANSLATOR.getTranslation(Tags.YES) + "   ",
													"   " + TRANSLATOR.getTranslation(Tags.NO) + "   "};
											int[] optionIds = new int[] { 0, 1 };
											int result = PluginWorkspaceProvider.getPluginWorkspace().showConfirmDialog(
													TRANSLATOR.getTranslation(Tags.CLEAR_HISTORY),
													TRANSLATOR.getTranslation(Tags.CLEAR_HISTORY_CONFIRMATION),
													options,
													optionIds);
											if (result == optionIds[0]) {
												clearHistory();
											} else {
												workingCopyCombo.setSelectedItem(workingCopyCombo.getModel().getElementAt(0));
											}
										});
									} else {
										GIT_ACCESS.setRepositoryAsync(selectedEntry);
									}
								} finally {
									inhibitRepoUpdate = false;
								}
							}
						});
	}

	/**
	 * Adds a state change listener on the working copy selector combo box. When a
	 * new working copy is selected this listener will execute
	 */
	private void addWorkingCopySelectorListener() {
	  workingCopyCombo.addItemListener(
	      new ItemListener() { // NOSONAR
	    @Override
	    public void itemStateChanged(ItemEvent e) {
	      // Don't do anything if the event was originated by us.
	      if (!inhibitRepoUpdate && e.getStateChange() == ItemEvent.SELECTED) {
	        inhibitRepoUpdate = true;
	        try {
	          // get and save the selected Option so that at restart the same
	          // repository will be selected
	          String selectedEntry = (String) workingCopyCombo.getSelectedItem();
	          logger.debug("Selected working copy: " + selectedEntry);
	          if (CLEAR_HISTORY_ENTRY.equals(selectedEntry)) {
	            SwingUtilities.invokeLater(() -> {
	              String[] options = new String[] {
	                  "   " + translator.getTranslation(Tags.YES) + "   ",
	                  "   " + translator.getTranslation(Tags.NO) + "   "};
	              int[] optionIds = new int[] { 0, 1 };
	              int result = ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace()).showConfirmDialog(
	                  translator.getTranslation(Tags.CLEAR_HISTORY),
	                  translator.getTranslation(Tags.CLEAR_HISTORY_CONFIRMATION),
	                  options,
	                  optionIds);
	              if (result == optionIds[0]) {
	                clearHistory();
	              } else {
	                workingCopyCombo.setSelectedItem(workingCopyCombo.getModel().getElementAt(0));
	              }
	            });
	          } else {
	            gitAccess.setRepositoryAsync(selectedEntry);
	          }
	        } finally {
	          inhibitRepoUpdate = false;
	        }
	      }
	    }
	  });
	}

Replace Anonymous With Lambda com.oxygenxml.git.view.staging.WorkingCopySelectionPanel.addWorkingCopySelectorListener.addItemListener.new ItemListener with e -> {if(!inhibitRepoUpdate && e.getStateChange() == ItemEvent.SELECTED){inhibitRepoUpdate=true; in method private addWorkingCopySelectorListener() : void from class com.oxygenxml.git.view.staging.WorkingCopySelectionPanel


	/**
	 * Adds a file chooser to the browse button.
	 */
	private void addFileChooserListner() {
		// NOSONAR
		browseButton.addActionListener(
						e -> {
							File directory = PluginWorkspaceProvider.getPluginWorkspace().chooseDirectory();
							if (directory != null) {
								String directoryPath = directory.getAbsolutePath();
								if (FileUtil.isGitRepository(directoryPath)) {
									// adds the directory path to the combo box if it doesn't already exist
									OptionsManager.getInstance().addRepository(directoryPath);

									// Insert it first.
									DefaultComboBoxModel<String> defaultComboBoxModel = (DefaultComboBoxModel<String>) workingCopyCombo.getModel();
									defaultComboBoxModel.removeElement(directoryPath);
									defaultComboBoxModel.insertElementAt(directoryPath, 0);
									if (defaultComboBoxModel.getSize() == 2
											&& defaultComboBoxModel.getIndexOf(CLEAR_HISTORY_ENTRY) == -1) {
										// When there is another entry in the model except for the selected one,
										// also add the "Clear history..." entry
										defaultComboBoxModel.addElement(CLEAR_HISTORY_ENTRY);
									}

									// sets the directory path as the selected repository
									SwingUtilities.invokeLater(() -> workingCopyCombo.setSelectedItem(directoryPath));
								} else {
									PluginWorkspaceProvider.getPluginWorkspace()
											.showInformationMessage(TRANSLATOR.getTranslation(Tags.WORKINGCOPY_NOT_GIT_DIRECTORY));
								}
							}
						});

	}

	/**
	 * Adds a file chooser to the browse button.
	 */
	private void addFileChooserListner() {
		browseButton.addActionListener(
		    new ActionListener() { // NOSONAR

			@Override
      public void actionPerformed(ActionEvent e) {
				File directory = ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace()).chooseDirectory();
				if (directory != null) {
					String directoryPath = directory.getAbsolutePath();
					if (FileUtil.isGitRepository(directoryPath) && directoryPath != null) {
						// adds the directory path to the combo box if it doesn't already exist
					  OptionsManager.getInstance().addRepository(directoryPath);

					  // Insert it first.
						DefaultComboBoxModel<String> defaultComboBoxModel = (DefaultComboBoxModel<String>) workingCopyCombo.getModel();
						defaultComboBoxModel.removeElement(directoryPath);
            defaultComboBoxModel.insertElementAt(directoryPath, 0);
            if (defaultComboBoxModel.getSize() == 2
                && defaultComboBoxModel.getIndexOf(CLEAR_HISTORY_ENTRY) == -1) {
              // When there is another entry in the model except for the selected one,
              // also add the "Clear history..." entry
              defaultComboBoxModel.addElement(CLEAR_HISTORY_ENTRY);
            }

						// sets the directory path as the selected repository
						SwingUtilities.invokeLater(() -> workingCopyCombo.setSelectedItem(directoryPath));
					} else {
						PluginWorkspaceProvider.getPluginWorkspace()
								.showInformationMessage(translator.getTranslation(Tags.WORKINGCOPY_NOT_GIT_DIRECTORY));
					}
				}
			}
		});

	}

Replace Anonymous With Lambda com.oxygenxml.git.view.staging.WorkingCopySelectionPanel.addFileChooserListner.addActionListener.new ActionListener with e -> {File directory=PluginWorkspaceProvider.getPluginWorkspace().chooseDirectory(); in method private addFileChooserListner() : void from class com.oxygenxml.git.view.staging.WorkingCopySelectionPanel


  /**
   * Saves the given repository options
   *
   * @param repositoryOption
   *          - options to be saved
   */
  public void addRepository(String repositoryOption) {
    List<String> locations = new ArrayList<>(getOptions().getRepositoryLocations().getLocations());
    locations.remove(repositoryOption);
    locations.add(0, repositoryOption);
    if(locations.size() > HISTORY_MAX_COUNT) {
      locations.remove(locations.size() - 1);
    }

    RepositoryLocations newRepositoryLocations = new RepositoryLocations();
    newRepositoryLocations.setLocations(locations);
    getOptions().setRepositoryLocations(newRepositoryLocations);
  }

  /**
   * Saves the given repository options
   *
   * @param repositoryOption
   *          - options to be saved
   */
  public void addRepository(String repositoryOption) {
    List<String> locations = new ArrayList<String>(getOptions().getRepositoryLocations().getLocations());
    locations.remove(repositoryOption);
    locations.add(0, repositoryOption);
    if(locations.size() > HISTORY_MAX_COUNT) {
      locations.remove(locations.size() - 1);
    }

    RepositoryLocations newRepositoryLocations = new RepositoryLocations();
    newRepositoryLocations.setLocations(locations);
    getOptions().setRepositoryLocations(newRepositoryLocations);
  }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public addRepository(repositoryOption String) : void from class com.oxygenxml.git.options.OptionsManager


/**
   *
Description: tests the pop method

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashPop() throws Exception {
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("modify");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit commitStash = gitAccess.createStash(false);
    assertFalse(isStashEmpty());

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("", content);

    assertEquals(StashApplyStatus.APPLIED_SUCCESSFULLY, gitAccess.popStash(commitStash.getName()));

    assertEquals(0, gitAccess.listStashes().size());

    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

/**
   *
Description: tests the pop method

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashPop() throws Exception {
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("modify");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit commitStash = gitAccess.createStash(false);
    assertFalse(isStashEmpty());

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("", content);

    assertEquals(StashApplyStatus.APPLIED_SUCCESSFULLY, gitAccess.popStash(commitStash.getName()));

    assertEquals(0, gitAccess.listStashes().size());

    reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertEquals("modify", content);
  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testStashPop() : void from class com.oxygenxml.git.service.GitAccessStashTest


/**
   *
Description: tests the situation in which we want to apply a stash and we have committed changes that do cause conflicts.

   *
Bug ID:EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashWithCommittedChangesWithConflicts() throws Exception {
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("test");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit ref = gitAccess.createStash(false);
    assertFalse(isStashEmpty());
    try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
      out.println("modify");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.add(new FileStatus(GitChangeType.MODIFIED, "test.txt"));
    gitAccess.commit("file test modified");
    assertNull(gitAccess.createStash(false));

    gitAccess.applyStash(ref.getName());

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertTrue(content.contains("<<<<<<<") || content.contains("=======") || content.contains(">>>>>>>"));
  }

/**
   *
Description: tests the situation in which we want to apply a stash and we have committed changes that do cause conflicts.

   *
Bug ID:EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashWithCommittedChangesWithConflicts() throws Exception {
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("test");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.addAll(gitAccess.getUnstagedFiles());

    assertTrue(isStashEmpty());
    RevCommit ref = gitAccess.createStash(false);
    assertFalse(isStashEmpty());
    try {
      PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
      out.println("modify");
      out.close();
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
    gitAccess.add(new FileStatus(GitChangeType.MODIFIED, "test.txt"));
    gitAccess.commit("file test modified");
    assertNull(gitAccess.createStash(false));

    gitAccess.applyStash(ref.getName());

    BufferedReader reader = new BufferedReader(new FileReader(LOCAL_TEST_REPOSITORY + "/test.txt"));
    String content = reader.lines().collect(Collectors.joining(System.lineSeparator()));
    reader.close();
    assertTrue(content.contains("<<<<<<<") || content.contains("=======") || content.contains(">>>>>>>"));
  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testStashWithCommittedChangesWithConflicts() : void from class com.oxygenxml.git.service.GitAccessStashTest


/**
   *
Description: tests the drop all method

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashDropAll() throws Exception {

    String[] texts = {"test1", "test2", "test3", "test4",
        "test5", "test6", "test7", "test8", "test9", "test10"};

    for(String fileAddedContent: texts) {
      try (PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) {
        out.println(fileAddedContent);
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
      gitAccess.addAll(gitAccess.getUnstagedFiles());

      RevCommit commitStash = gitAccess.createStash(true);
      assertNotNull(commitStash);
    }

    assertEquals(10, gitAccess.listStashes().size());

    gitAccess.dropAllStashes();

    assertTrue(isStashEmpty());

  }

/**
   *
Description: tests the drop all method

   *
Bug ID: EXM-45983

   *
   * @author Alex_Smarandache
   *
   * @throws Exception
   */
  @Test
  public void testStashDropAll() throws Exception {

    String[] texts = {"test1", "test2", "test3", "test4",
        "test5", "test6", "test7", "test8", "test9", "test10"};

    for(String fileAddedContent: texts) {
      try {
        PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt");
        out.println(fileAddedContent);
        out.close();
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
      gitAccess.addAll(gitAccess.getUnstagedFiles());

      RevCommit commitStash = gitAccess.createStash(true);
      assertNotNull(commitStash);
    }

    assertEquals(10, gitAccess.listStashes().size());

    gitAccess.dropAllStashes();

    assertTrue(isStashEmpty());

  }

Try With Resources try(PrintWriter out=new PrintWriter(LOCAL_TEST_REPOSITORY + "/test.txt")) in method public testStashDropAll() : void from class com.oxygenxml.git.service.GitAccessStashTest


  /**
   * Reverts the given commit.
   *
   * @param commitId  The commit id to which to reset.
   * @throws NoRepositorySelected
   * @throws IOException
   */
  public void revertCommit(String commitId) throws IOException, NoRepositorySelected {
    fireOperationAboutToStart(new GitEventInfo(GitOperation.REVERT_COMMIT));
    Repository repo = git.getRepository();
    try (RevWalk revWalk = new RevWalk(repo)) {
      RevCommit revcom = revWalk.parseCommit(getRepository().resolve(commitId));
      git.revert().include(revcom).call();
      fireOperationSuccessfullyEnded(new GitEventInfo(GitOperation.REVERT_COMMIT));
    } catch (GitAPIException|RevisionSyntaxException e) {
      fireOperationFailed(new GitEventInfo(GitOperation.REVERT_COMMIT), e);
      PluginWorkspaceProvider.getPluginWorkspace().showErrorMessage(e.getMessage(), e);
    }
  }

  /**
   * Reverts the last commit.
   *
   * @param resetType The reset type to perform on the current branch.
   * @param commitId  The commit id to which to reset.
   * @throws NoRepositorySelected
   * @throws IOException
   */
  public void revertCommit(String commitId) throws IOException, NoRepositorySelected {
    fireOperationAboutToStart(new GitEventInfo(GitOperation.REVERT_COMMIT));
    Repository repo = git.getRepository();
    try {
      RevWalk revWalk = new RevWalk(repo);
      RevCommit revcom = revWalk.parseCommit(getRepository().resolve(commitId));
      git.revert().include(revcom).call();
      fireOperationSuccessfullyEnded(new GitEventInfo(GitOperation.REVERT_COMMIT));
    } catch (GitAPIException e) {
      fireOperationFailed(new GitEventInfo(GitOperation.REVERT_COMMIT), e);
      PluginWorkspaceProvider.getPluginWorkspace().showErrorMessage(e.getMessage(), e);
    }
  }

Try With Resources try(RevWalk revWalk=new RevWalk(repo)) in method public revertCommit(commitId String) : void from class com.oxygenxml.git.service.GitAccess


	/**
	 * Constructor.
	 *
	 * @param pushPullController Push / pull controller.
	 */
	public CommitAndStatusPanel(PushPullController pushPullController) {
	  this.pushPullController = pushPullController;
	  this.observers = new HashSet<>();

	  // By default a swing timer is on repeat.
	  commitButtonAndMessageUpdateTaskTimer.setRepeats(false);

    createGUI();

    GitAccess.getInstance().addGitListener(new GitEventAdapter() {
      @Override
      public void repositoryChanged() {
        Repository repository;
        try {
          repository = gitAccess.getRepository();
          if (repository != null) {
            // When a new working copy is selected clear the commit text area
            reset();

            // checks what buttons to keep active and what buttons to deactivate
            toggleCommitButtonAndUpdateMessageArea(false);
          }
        } catch (NoRepositorySelected e) {
          logger.debug(e, e);
        }
      }

      @Override
      public void branchChanged(String oldBranch, String newBranch) {
        reset();
      }

      @Override
      public void stateChanged(GitEvent changeEvent) {
        GitCommand cmd = changeEvent.getGitCommand();
        GitCommandState cmdState = changeEvent.getGitComandState();
        toggleCommitButtonAndUpdateMessageArea(
            cmd == GitCommand.STAGE && cmdState == GitCommandState.SUCCESSFULLY_ENDED);
      }
    });
  }

	/**
	 * Constructor.
	 *
	 * @param pushPullController Push / pull controller.
	 */
	public CommitAndStatusPanel(PushPullController pushPullController) {
	  this.pushPullController = pushPullController;
	  this.observers = new HashSet<Observer<PushPullEvent>>();

	  // By default a swing timer is on repeat.
	  commitButtonAndMessageUpdateTaskTimer.setRepeats(false);

    createGUI();

    GitAccess.getInstance().addGitListener(new GitEventAdapter() {
      @Override
      public void repositoryChanged() {
        Repository repository;
        try {
          repository = gitAccess.getRepository();
          if (repository != null) {
            // When a new working copy is selected clear the commit text area
            reset();

            // checks what buttons to keep active and what buttons to deactivate
            toggleCommitButtonAndUpdateMessageArea(false);
          }
        } catch (NoRepositorySelected e) {
          logger.debug(e, e);
        }
      }

      @Override
      public void branchChanged(String oldBranch, String newBranch) {
        reset();
      }

      @Override
      public void stateChanged(GitEvent changeEvent) {
        GitCommand cmd = changeEvent.getGitCommand();
        GitCommandState cmdState = changeEvent.getGitComandState();
        toggleCommitButtonAndUpdateMessageArea(
            cmd == GitCommand.STAGE && cmdState == GitCommandState.SUCCESSFULLY_ENDED);
      }
    });
  }

Replace Generic With Diamond HashSet<Observer<PushPullEvent>> with HashSet<> in method public CommitAndStatusPanel(pushPullController PushPullController) from class com.oxygenxml.git.view.CommitAndStatusPanel


  /**
   * Public constructor
   */
  public PushPullController() {
    observers = new HashSet<>();
  }

  /**
   * Public constructor
   */
  public PushPullController() {
    observers = new HashSet<Observer<PushPullEvent>>();
  }

Replace Generic With Diamond HashSet<Observer<PushPullEvent>> with HashSet<> in method public PushPullController() from class com.oxygenxml.git.view.event.PushPullController


/**
   * Checks in the remote repository if there are new commits.
   * @return commitsAhead a list with all new commits
   */
  private static List<RevCommit> checkForRemoteCommits() {
    GitAccess gitAccess = GitAccess.getInstance();
    Repository repo;
    List<RevCommit> commitsAhead = new ArrayList<>();
    try {
      gitAccess.fetch();
      repo = gitAccess.getRepository();
      CommitsAheadAndBehind commitsAheadAndBehind = RevCommitUtil.getCommitsAheadAndBehind(repo, repo.getFullBranch());
      commitsAhead = commitsAheadAndBehind.getCommitsAhead();

    } catch (NoRepositorySelected | IOException | SSHPassphraseRequiredException | PrivateRepositoryException
        | RepositoryUnavailableException e) {
      logger.error(e, e);
    }
    return commitsAhead;
  }

/**
   * Checks in the remote repository if there are new commits.
   * @return commitsAhead a list with all new commits
   */
  private static List<RevCommit> checkForRemoteCommits() {
    GitAccess gitAccess = GitAccess.getInstance();
    Repository repo;
    List<RevCommit> commitsAhead = new ArrayList<RevCommit>();
    try {
      gitAccess.fetch();
      repo = gitAccess.getRepository();
      CommitsAheadAndBehind commitsAheadAndBehind = RevCommitUtil.getCommitsAheadAndBehind(repo, repo.getFullBranch());
      commitsAhead = commitsAheadAndBehind.getCommitsAhead();

    } catch (NoRepositorySelected | IOException | SSHPassphraseRequiredException | PrivateRepositoryException
        | RepositoryUnavailableException e) {
      logger.error(e, e);
    }
    return commitsAhead;
  }

Replace Generic With Diamond ArrayList<RevCommit> with ArrayList<> in method private checkForRemoteCommits() : List<RevCommit> from class com.oxygenxml.git.watcher.RepositoryChangeListeners


	/**
	 * Pulls the files that are not on the local repository from the remote
	 * repository
	 *
	 * @param username Git username
	 * @param password Git password
	 * @param pullType One of ff, no-ff, ff-only, rebase.
	 *
	 * @return The result, if successful.
	 *
	 * @throws CheckoutConflictException There is a conflict between the local
	 *                                   repository and the remote one. The same
	 *                                   file that is in conflict is changed inside
	 *                                   the working copy so operation is aborted.
	 * @throws GitAPIException other errors.
	 */
  public PullResponse pull(String username, String password, PullType pullType) throws GitAPIException {
	  PullResponse pullResponseToReturn = new PullResponse(PullStatus.OK, new HashSet<>());
	  AuthenticationInterceptor.install();

		if (!getConflictingFiles().isEmpty()) {
			pullResponseToReturn.setStatus(PullStatus.REPOSITORY_HAS_CONFLICTS);
		} else {
		  git.reset().call();

		  // Call "Pull"
		  Repository repository = git.getRepository();
		  ObjectId oldHead = resolveHead(repository);
		  String sshPassphrase = OptionsManager.getInstance().getSshPassphrase();
		  SSHCapableUserCredentialsProvider credentialsProvider =
		      new SSHCapableUserCredentialsProvider(username, password, sshPassphrase, getHostName());
      PullCommand pullCmd = git.pull()
          .setRebase(PullType.REBASE == pullType)
          .setCredentialsProvider(credentialsProvider);
      PullResult pullCommandResult = pullCmd.call();

		  // Get fetch result
		  Collection<TrackingRefUpdate> trackingRefUpdates = pullCommandResult.getFetchResult().getTrackingRefUpdates();
		  String lockFailureMessage = createLockFailureMessageIfNeeded(trackingRefUpdates);
		  if (!lockFailureMessage.isEmpty()) {
		    // Lock failure
		    ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace())
            .showErrorMessage(translator.getTranslation(lockFailureMessage));
		    pullResponseToReturn.setStatus(PullStatus.LOCK_FAILED);
		  } else {
		    ObjectId head = resolveHead(repository);
		    if (oldHead != null && head != null) {
		      refreshProject(repository, oldHead, head);
		    }

		    RebaseResult rebaseResult = pullCommandResult.getRebaseResult();
		    if (rebaseResult != null) {
		      treatRebaseResult(pullResponseToReturn, rebaseResult);
		    } else {
		    treatMergeResult(pullResponseToReturn, pullCommandResult.getMergeResult());
		  }
		}
		}

		return pullResponseToReturn;

	}

	/**
	 * Pulls the files that are not on the local repository from the remote
	 * repository
	 *
	 * @param username Git username
	 * @param password Git password
	 * @param pullType One of ff, no-ff, ff-only, rebase.
	 *
	 * @return The result, if successful.
	 *
	 * @throws CheckoutConflictException There is a conflict between the local
	 *                                   repository and the remote one. The same
	 *                                   file that is in conflict is changed inside
	 *                                   the working copy so operation is aborted.
	 * @throws GitAPIException other errors.
	 */
  public PullResponse pull(String username, String password, PullType pullType) throws GitAPIException {
	  PullResponse pullResponseToReturn = new PullResponse(PullStatus.OK, new HashSet<String>());
	  AuthenticationInterceptor.install();

		if (!getConflictingFiles().isEmpty()) {
			pullResponseToReturn.setStatus(PullStatus.REPOSITORY_HAS_CONFLICTS);
		} else {
		  git.reset().call();

		  // Call "Pull"
		  Repository repository = git.getRepository();
		  ObjectId oldHead = resolveHead(repository);
		  String sshPassphrase = OptionsManager.getInstance().getSshPassphrase();
		  SSHCapableUserCredentialsProvider credentialsProvider =
		      new SSHCapableUserCredentialsProvider(username, password, sshPassphrase, getHostName());
      PullCommand pullCmd = git.pull()
          .setRebase(PullType.REBASE == pullType)
          .setCredentialsProvider(credentialsProvider);
      PullResult pullCommandResult = pullCmd.call();

		  // Get fetch result
		  Collection<TrackingRefUpdate> trackingRefUpdates = pullCommandResult.getFetchResult().getTrackingRefUpdates();
		  String lockFailureMessage = createLockFailureMessageIfNeeded(trackingRefUpdates);
		  if (!lockFailureMessage.isEmpty()) {
		    // Lock failure
		    ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace())
            .showErrorMessage(translator.getTranslation(lockFailureMessage));
		    pullResponseToReturn.setStatus(PullStatus.LOCK_FAILED);
		  } else {
		    ObjectId head = resolveHead(repository);
		    if (oldHead != null && head != null) {
		      refreshProject(repository, oldHead, head);
		    }

		    RebaseResult rebaseResult = pullCommandResult.getRebaseResult();
		    if (rebaseResult != null) {
		      treatRebaseResult(pullResponseToReturn, rebaseResult);
		    } else {
		    treatMergeResult(pullResponseToReturn, pullCommandResult.getMergeResult());
		  }
		}
		}

		return pullResponseToReturn;

	}

Replace Generic With Diamond PullResponse with PullResponse in method public pull(username String, password String, pullType PullType) : PullResponse from class com.oxygenxml.git.service.GitAccess


	    @Override
      public void repositoryChanged() {
	      // Repository changed. Update the toolbar buttons.
	      submoduleSelectButton.setEnabled(gitRepoHasSubmodules());

	      // Update the toobars.
	      // calculate how many pushes ahead and pulls behind the current
	      // selected working copy is from the base. It is on thread because
	      // the fetch command takes a longer time
	      // TODO This might stay well in the Refresh support... When a new repository is
	      // selected this is triggered.
	      // TODO Maybe the change of repository should triggered a fetch and a notification should
	      // be fired when the fetch information is brought. It might make sense to use a coalescing for the fetch.
	      new Thread(() -> {
          fetch(true);
          // After the fetch is done, update the toolbar icons.
          updateStatus();
        }).start();
	    }

	    @Override
      public void repositoryChanged() {
	      // Repository changed. Update the toolbar buttons.
	      submoduleSelectButton.setEnabled(gitRepoHasSubmodules());

	      // Update the toobars.
	      // calculate how many pushes ahead and pulls behind the current
	      // selected working copy is from the base. It is on thread because
	      // the fetch command takes a longer time
	      // TODO This might stay well in the Refresh support... When a new repository is
	      // selected this is triggered.
	      // TODO Maybe the change of repository should triggered a fetch and a notification should
	      // be fired when the fetch information is brought. It might make sense to use a coalescing for the fetch.
	      new Thread(new Runnable() {
	        @Override
	        public void run() {
	          fetch(true);

	          // After the fetch is done, update the toolbar icons.
	          updateStatus();
	        }
	      }).start();
	    }

Replace Anonymous With Lambda com.oxygenxml.git.view.ToolbarPanel.ToolbarPanel.addGitListener.new GitEventAdapter.repositoryChanged.start.new Thread.new Runnable with () -> {fetch(true); in method public repositoryChanged() : void from class com.oxygenxml.git.view.ToolbarPanel.ToolbarPanel.addGitListener.new GitEventAdapter


	/**
	 * Update the counters presented on the Pull/Push toolbar action.
	 */
	private void updateCounters() {
    // Connect to the remote.
    RepositoryStatus status = RepositoryStatus.AVAILABLE;
    try {
      GitAccess.getInstance().fetch();
    } catch (RepositoryUnavailableException e) {
      status = RepositoryStatus.UNAVAILABLE;
    } catch (Exception e) {
      // Ignore other causes why the fetch might fail.
    }

    final RepositoryStatus fStatus = status;
	  SwingUtilities.invokeLater(() -> {
      stagingPanel.getCommitPanel().setStatus(fStatus);
      stagingPanel.getToolbarPanel().updateStatus();
    });
	}

	/**
	 * Update the counters presented on the Pull/Push toolbar action.
	 */
	private void updateCounters() {
    // Connect to the remote.
    RepositoryStatus status = RepositoryStatus.AVAILABLE;
    try {
      GitAccess.getInstance().fetch();
    } catch (RepositoryUnavailableException e) {
      status = RepositoryStatus.UNAVAILABLE;
    } catch (Exception e) {
      // Ignore other causes why the fetch might fail.
    }

    final RepositoryStatus fStatus = status;
	  SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        stagingPanel.getCommitPanel().setStatus(fStatus);
        stagingPanel.getToolbarPanel().updateStatus();
      }
    });
	}

Replace Anonymous With Lambda com.oxygenxml.git.utils.PanelRefresh.updateCounters.invokeLater.new Runnable with () -> {stagingPanel.getCommitPanel().setStatus(fStatus); in method private updateCounters() : void from class com.oxygenxml.git.utils.PanelRefresh


			@Override
			public void focusGained(final FocusEvent e) {
				focusGained = true;
				// The focus is somewhere in he view.
				if (!inTheView) {
				  // EXM-40880: Invoke later so that the focus event gets processed.
				  SwingUtilities.invokeLater(() -> refreshSupport.call());
				}

				inTheView = true;
			}

			@Override
			public void focusGained(final FocusEvent e) {
				focusGained = true;
				// The focus is somewhere in he view.
				if (!inTheView) {
				  // EXM-40880: Invoke later so that the focus event gets processed.
				  SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
              refreshSupport.call();
            }
          });
				}

				inTheView = true;
			}

Replace Anonymous With Lambda com.oxygenxml.git.view.StagingPanel.createGUI.installFocusListener.new FocusAdapter.focusGained.invokeLater.new Runnable with () -> refreshSupport.call() in method public focusGained(e FocusEvent) : void from class com.oxygenxml.git.view.StagingPanel.createGUI.installFocusListener.new FocusAdapter


	    @Override
	    public void repositoryOpeningFailed(File repo, Throwable ex) {
	      if (workingCopyCombo != null) {
	        if (ex instanceof RepositoryNotFoundException) {
	          // We are here if the selected Repository doesn't exists anymore
	          OptionsManager.getInstance().removeRepositoryLocation(repo.getAbsolutePath());
	          if (workingCopyCombo.getItemCount() > 0) {
	            workingCopyCombo.setSelectedItem(0);
	          } else {
	            workingCopyCombo.setSelectedItem(null);
	            gitAccess.closeRepo();
	          }
	          workingCopyCombo.removeItem(repo.getAbsoluteFile());

	          SwingUtilities.invokeLater(() -> PluginWorkspaceProvider.getPluginWorkspace()
	                .showInformationMessage(translator.getTranslation(Tags.WORKINGCOPY_REPOSITORY_NOT_FOUND)));
	        } else if (ex instanceof IOException) {
	          JOptionPane.showMessageDialog(
	              (Component) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame(),
	              "Could not load the repository. " + ex.getMessage());
	        }
	        workingCopyCombo.setEnabled(true);
	      }
	      if (browseButton != null) {
          browseButton.setEnabled(true);
        }
	    }

	    @Override
	    public void repositoryOpeningFailed(File repo, Throwable ex) {
	      if (workingCopyCombo != null) {
	        if (ex instanceof RepositoryNotFoundException) {
	          // We are here if the selected Repository doesn't exists anymore
	          OptionsManager.getInstance().removeRepositoryLocation(repo.getAbsolutePath());
	          if (workingCopyCombo.getItemCount() > 0) {
	            workingCopyCombo.setSelectedItem(0);
	          } else {
	            workingCopyCombo.setSelectedItem(null);
	            gitAccess.closeRepo();
	          }
	          workingCopyCombo.removeItem(repo.getAbsoluteFile());

	          SwingUtilities.invokeLater(new Runnable() {
	            @Override
	            public void run() {
	              PluginWorkspaceProvider.getPluginWorkspace()
	              .showInformationMessage(translator.getTranslation(Tags.WORKINGCOPY_REPOSITORY_NOT_FOUND));
	            }
	          });
	        } else if (ex instanceof IOException) {
	          JOptionPane.showMessageDialog(
	              (Component) PluginWorkspaceProvider.getPluginWorkspace().getParentFrame(),
	              "Could not load the repository. " + ex.getMessage());
	        }
	        workingCopyCombo.setEnabled(true);
	      }
	      if (browseButton != null) {
          browseButton.setEnabled(true);
        }
	    }

Replace Anonymous With Lambda com.oxygenxml.git.view.WorkingCopySelectionPanel.WorkingCopySelectionPanel.addGitListener.new GitEventAdapter.repositoryOpeningFailed.invokeLater.new Runnable with () -> PluginWorkspaceProvider.getPluginWorkspace().showInformationMessage(translator.getTranslation(Tags.WORKINGCOPY_REPOSITORY_NOT_FOUND)) in method public repositoryOpeningFailed(repo File, ex Throwable) : void from class com.oxygenxml.git.view.WorkingCopySelectionPanel.WorkingCopySelectionPanel.addGitListener.new GitEventAdapter


	/**
	 * Adds a mouse listener to the tree: When the user right clicks on a node, a
	 * contextual menu will pop. Also when the user double clicks on a leaf node
	 * an action will occur depending on it's file status. If the status is MODIFY
	 * the open in compare editor will be executed, if the status is Add the file
	 * will be opened in the Oxygen
	 */
	private void addTreeMouseListener() {
	  tree.getSelectionModel().addTreeSelectionListener(e -> toggleSelectedButton());

	  tree.addMouseListener(new MouseAdapter() {
	    @Override
	    public void mousePressed(MouseEvent e) {
	      // For MacOS the popup trigger comes on mouse pressed.
	      handleContextualMenuEvent(e);
	    }

	    @Override
	    public void mouseReleased(MouseEvent e) {
	      // Switching between Staged and UnStaged with right click introduced some paint artifacts.
	      tree.requestFocus();
	      tree.repaint();

	      // Maybe the event was a (not pop-up trigger) double-click
	      showDiff(e);
	      // Or maybe it was a right click
	      handleContextualMenuEvent(e);
	    }

	    /**
	     * Shows the contextual menu, if the mouse event is a pop-up trigger.
	     *
	     * @param e Mouse event.
	     */
	    private void handleContextualMenuEvent(MouseEvent e) {
	      if (e.isPopupTrigger() && e.getClickCount() == 1) {
	        // ============= Right click event ================
	        // First, check the node under the mouse.
	        TreePath treePath = tree.getPathForLocation(e.getX(), e.getY());
	        if (treePath != null) {
	          boolean treeInSelection = false;
	          TreePath[] paths = tree.getSelectionPaths();
	          // The node under the mouse might not be the selected one.
	          // A JTree only updates selection for a left button. Also do it for a right click.
	          if (paths != null) {
	            for (int i = 0; i < paths.length; i++) {
	              if (treePath.equals(paths[i])) {
	                treeInSelection = true;
	                break;
	              }
	            }
	          }
	          if (!treeInSelection) {
	            tree.setSelectionPath(treePath);
	          }
	        } else {
	          // A click outside the tree. Go with a selected path.
	          treePath = tree.getSelectionPath();
	        }

	        if (treePath != null) {
	          String stringPath = TreeFormatter.getStringPath(treePath);
	          StagingResourcesTreeModel model = (StagingResourcesTreeModel) tree.getModel();
	          GitTreeNode node = TreeFormatter.getTreeNodeFromString(model, stringPath);

	          if (!node.isRoot()
	              || node.children().hasMoreElements()
	              || isMergingResolved()) {

	            showContextualMenuForTree(e.getX(), e.getY(), model);
	          }
	        }
	      }
	    }

	    /**
	     * Shows DIFF for a double click mouse event.
	     *
	     * @param e Mouse event.
	     */
	    private void showDiff(MouseEvent e) {
	      if (!e.isPopupTrigger() && e.getClickCount() == 2) {
	        // ============= Double click event ==============
	        TreePath treePath = tree.getPathForLocation(e.getX(), e.getY());
	        if (treePath != null) {
	          String stringPath = TreeFormatter.getStringPath(treePath);
	          StagingResourcesTreeModel model = (StagingResourcesTreeModel) tree.getModel();
	          GitTreeNode node = TreeFormatter.getTreeNodeFromString(model, stringPath);
	          if (model.isLeaf(node) && !model.getRoot().equals(node)) {
	            FileStatus file = model.getFileByPath(stringPath);
	            DiffPresenter.showDiff(file, stageController);
	          }
	        }
	      }
	    }
	  });
	}

	/**
	 * Adds a mouse listener to the tree: When the user right clicks on a node, a
	 * contextual menu will pop. Also when the user double clicks on a leaf node
	 * an action will occur depending on it's file status. If the status is MODIFY
	 * the open in compare editor will be executed, if the status is Add the file
	 * will be opened in the Oxygen
	 */
	private void addTreeMouseListener() {
	  tree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        toggleSelectedButton();
      }
    });

	  tree.addMouseListener(new MouseAdapter() {
	    @Override
	    public void mousePressed(MouseEvent e) {
	      // For MacOS the popup trigger comes on mouse pressed.
	      handleContextualMenuEvent(e);
	    }

	    @Override
	    public void mouseReleased(MouseEvent e) {
	      // Switching between Staged and UnStaged with right click introduced some paint artifacts.
	      tree.requestFocus();
	      tree.repaint();

	      // Maybe the event was a (not pop-up trigger) double-click
	      showDiff(e);
	      // Or maybe it was a right click
	      handleContextualMenuEvent(e);
	    }

	    /**
	     * Shows the contextual menu, if the mouse event is a pop-up trigger.
	     *
	     * @param e Mouse event.
	     */
	    private void handleContextualMenuEvent(MouseEvent e) {
	      if (e.isPopupTrigger() && e.getClickCount() == 1) {
	        // ============= Right click event ================
	        // First, check the node under the mouse.
	        TreePath treePath = tree.getPathForLocation(e.getX(), e.getY());
	        if (treePath != null) {
	          boolean treeInSelection = false;
	          TreePath[] paths = tree.getSelectionPaths();
	          // The node under the mouse might not be the selected one.
	          // A JTree only updates selection for a left button. Also do it for a right click.
	          if (paths != null) {
	            for (int i = 0; i < paths.length; i++) {
	              if (treePath.equals(paths[i])) {
	                treeInSelection = true;
	                break;
	              }
	            }
	          }
	          if (!treeInSelection) {
	            tree.setSelectionPath(treePath);
	          }
	        } else {
	          // A click outside the tree. Go with a selected path.
	          treePath = tree.getSelectionPath();
	        }

	        if (treePath != null) {
	          String stringPath = TreeFormatter.getStringPath(treePath);
	          StagingResourcesTreeModel model = (StagingResourcesTreeModel) tree.getModel();
	          GitTreeNode node = TreeFormatter.getTreeNodeFromString(model, stringPath);

	          if (!node.isRoot()
	              || node.children().hasMoreElements()
	              || isMergingResolved()) {

	            showContextualMenuForTree(e.getX(), e.getY(), model);
	          }
	        }
	      }
	    }

	    /**
	     * Shows DIFF for a double click mouse event.
	     *
	     * @param e Mouse event.
	     */
	    private void showDiff(MouseEvent e) {
	      if (!e.isPopupTrigger() && e.getClickCount() == 2) {
	        // ============= Double click event ==============
	        TreePath treePath = tree.getPathForLocation(e.getX(), e.getY());
	        if (treePath != null) {
	          String stringPath = TreeFormatter.getStringPath(treePath);
	          StagingResourcesTreeModel model = (StagingResourcesTreeModel) tree.getModel();
	          GitTreeNode node = TreeFormatter.getTreeNodeFromString(model, stringPath);
	          if (model.isLeaf(node) && !model.getRoot().equals(node)) {
	            FileStatus file = model.getFileByPath(stringPath);
	            DiffPresenter.showDiff(file, stageController);
	          }
	        }
	      }
	    }
	  });
	}

Replace Anonymous With Lambda com.oxygenxml.git.view.ChangesPanel.addTreeMouseListener.addTreeSelectionListener.new TreeSelectionListener with e -> toggleSelectedButton() in method private addTreeMouseListener() : void from class com.oxygenxml.git.view.ChangesPanel


	/**
	 * Adds a listener on the changeAll button: When clicked all the files will go
	 * in the staging or unstaging area, depending on the forStaging variable
	 */
	private void addChangeAllButtonListener() {
		changeAllButton.addActionListener(e -> {
      if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
        StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
        fileTableModel.switchAllFilesStageState();
      } else {
        StagingResourcesTreeModel treeModel = (StagingResourcesTreeModel) tree.getModel();
        treeModel.switchAllFilesStageState();
      }
    });
	}

	/**
	 * Adds a listener on the changeAll button: When clicked all the files will go
	 * in the staging or unstaging area, depending on the forStaging variable
	 */
	private void addChangeAllButtonListener() {
		changeAllButton.addActionListener(new ActionListener() {

			@Override
      public void actionPerformed(ActionEvent e) {
			  if (currentViewMode == ResourcesViewMode.FLAT_VIEW) {
			    StagingResourcesTableModel fileTableModel = (StagingResourcesTableModel) filesTable.getModel();
			    fileTableModel.switchAllFilesStageState();
			  } else {
			    StagingResourcesTreeModel treeModel = (StagingResourcesTreeModel) tree.getModel();
			    treeModel.switchAllFilesStageState();
			  }
			}
		});
	}

Replace Anonymous With Lambda com.oxygenxml.git.view.ChangesPanel.addChangeAllButtonListener.addActionListener.new ActionListener with e -> {if(currentViewMode == ResourcesViewMode.FLAT_VIEW){StagingResourcesTableModel fileTableModel=(StagingResourcesTableModel)filesTable.getModel(); in method private addChangeAllButtonListener() : void from class com.oxygenxml.git.view.ChangesPanel


	/**
	 * Adds the scollPane to the panel
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addFilesPanel(GridBagConstraints gbc) {
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				0, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.weightx = 1;
		gbc.weighty = 1;
		gbc.gridwidth = 3;

		filesTable = UIUtil.createResourcesTable(new StagingResourcesTableModel(stageController, forStagedResources), ()-> isContextMenuShowing);

		filesTable.getSelectionModel().addListSelectionListener(e -> {
      if (!e.getValueIsAdjusting()) {
        toggleSelectedButton();
      }
    });

		// Adds mouse listener on the table: When the user right clicks on an item
		// in the table, a
		// contextual menu will pop. Also when the user double clicks on a leaf node
		// an action will occur depending on it's file status. If the status is
		// MODIFY,
		// the open in compare editor will be executed, if the status is Add the
		// file
		// will be opened in the Oxygen.
		filesTable.addMouseListener(new MouseAdapter() {
		  @Override
		  public void mousePressed(MouseEvent e) {
	      // For MacOS the popup trigger comes on mouse pressed.
		    handleContexMenuEvent(e);
		  }

		  @Override
			public void mouseReleased(MouseEvent e) {
        // Switching between Staged and UnStaged with right click introduced some paint artifacts.
		    filesTable.requestFocus();
		    filesTable.repaint();

		    // Maybe the event is a pop-up trigger
				handleContexMenuEvent(e);
				// Maybe (not pop-up trigger) double click
        if (!e.isPopupTrigger() && e.getClickCount() == 2) {
          Point point = new Point(e.getX(), e.getY());
          int clickedRow = filesTable.rowAtPoint(point);
          if (clickedRow != -1) {
            openFileInCompareEditor(clickedRow);
          }
        }

			}

		  /**
		   * Present the contextual menu if this is the proper event.
		   *
		   * @param e Mouse event.
		   */
		  private void handleContexMenuEvent(MouseEvent e) {
		    if (e.isPopupTrigger() && e.getClickCount() == 1) {
		      Point point = new Point(e.getX(), e.getY());
		      int clickedRow = filesTable.rowAtPoint(point);
		      int[] selectedRows = filesTable.getSelectedRows();
		      if (clickedRow != -1) {
		        // Might be a right click over a non-selected row.
		        boolean inSelection = false;
		        for (int i = 0; i < selectedRows.length; i++) {
		          if (clickedRow == selectedRows[i]) {
		            inSelection = true;
		            break;
		          }
		        }

		        if (!inSelection) {
		          filesTable.setRowSelectionInterval(clickedRow, clickedRow);
		          selectedRows = filesTable.getSelectedRows();
		        }
		      }

		      if (selectedRows.length == 0) {
		        // When resolving a conflict "using mine" and there are no more entries in the tables,
		        // show the contextual menu for being able to restart the merging

		        GitStatus status = GitAccess.getInstance().getStatus();
		        if (status.getStagedFiles().isEmpty()
		            && status.getUnstagedFiles().isEmpty()
		            && isMergingResolved()) {
		          showContextualMenuForFlatView(e.getX(), e.getY(), new int[0]);
		        }
		      } else {
		        // ======== RIGHT CLICK ==========
		        showContextualMenuForFlatView(e.getX(), e.getY(), selectedRows);
		      }
		    }
		  }

		});

		filesTable.addKeyListener(new KeyAdapter() {
		  @Override
		  public void keyPressed(KeyEvent e) {
		    if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
		      int[] selectedRows = filesTable.getSelectedRows();
		      if (selectedRows.length > 0) {
		        Rectangle cellRect = filesTable.getCellRect(selectedRows[selectedRows.length - 1], 0, true);
		        showContextualMenuForFlatView(cellRect.x, cellRect.y + cellRect.height, selectedRows);
		      }
		    }
		  }
		});

		// Compare files on enter.
		filesTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
		    .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
		filesTable.getActionMap().put("Enter", new AbstractAction() {
			@Override
      public void actionPerformed(ActionEvent e) {
				int row = filesTable.convertRowIndexToModel(filesTable.getSelectedRow());
				if (row != -1) {
					openFileInCompareEditor(row);
				}
			}
		});

		scrollPane = new JScrollPane(filesTable);
		scrollPane.add(tree);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setPreferredSize(new Dimension(200, 200));
		filesTable.setFillsViewportHeight(true);
		this.add(scrollPane, gbc);

		setResourcesViewMode(currentViewMode);
	}

	/**
	 * Adds the scollPane to the panel
	 *
	 * @param gbc
	 *          - the constraints used for this component
	 */
	private void addFilesPanel(GridBagConstraints gbc) {
		gbc.insets = new Insets(UIConstants.COMPONENT_TOP_PADDING, UIConstants.COMPONENT_LEFT_PADDING,
				0, UIConstants.COMPONENT_RIGHT_PADDING);
		gbc.anchor = GridBagConstraints.WEST;
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.weightx = 1;
		gbc.weighty = 1;
		gbc.gridwidth = 3;

		filesTable = UIUtil.createResourcesTable(new StagingResourcesTableModel(stageController, forStagedResources), ()-> isContextMenuShowing);

		filesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      @Override
      public void valueChanged(ListSelectionEvent e) {
        if (!e.getValueIsAdjusting()) {
          toggleSelectedButton();
        }
      }
    });

		// Adds mouse listener on the table: When the user right clicks on an item
		// in the table, a
		// contextual menu will pop. Also when the user double clicks on a leaf node
		// an action will occur depending on it's file status. If the status is
		// MODIFY,
		// the open in compare editor will be executed, if the status is Add the
		// file
		// will be opened in the Oxygen.
		filesTable.addMouseListener(new MouseAdapter() {
		  @Override
		  public void mousePressed(MouseEvent e) {
	      // For MacOS the popup trigger comes on mouse pressed.
		    handleContexMenuEvent(e);
		  }

		  @Override
			public void mouseReleased(MouseEvent e) {
        // Switching between Staged and UnStaged with right click introduced some paint artifacts.
		    filesTable.requestFocus();
		    filesTable.repaint();

		    // Maybe the event is a pop-up trigger
				handleContexMenuEvent(e);
				// Maybe (not pop-up trigger) double click
        if (!e.isPopupTrigger() && e.getClickCount() == 2) {
          Point point = new Point(e.getX(), e.getY());
          int clickedRow = filesTable.rowAtPoint(point);
          if (clickedRow != -1) {
            openFileInCompareEditor(clickedRow);
          }
        }

			}

		  /**
		   * Present the contextual menu if this is the proper event.
		   *
		   * @param e Mouse event.
		   */
		  private void handleContexMenuEvent(MouseEvent e) {
		    if (e.isPopupTrigger() && e.getClickCount() == 1) {
		      Point point = new Point(e.getX(), e.getY());
		      int clickedRow = filesTable.rowAtPoint(point);
		      int[] selectedRows = filesTable.getSelectedRows();
		      if (clickedRow != -1) {
		        // Might be a right click over a non-selected row.
		        boolean inSelection = false;
		        for (int i = 0; i < selectedRows.length; i++) {
		          if (clickedRow == selectedRows[i]) {
		            inSelection = true;
		            break;
		          }
		        }

		        if (!inSelection) {
		          filesTable.setRowSelectionInterval(clickedRow, clickedRow);
		          selectedRows = filesTable.getSelectedRows();
		        }
		      }

		      if (selectedRows.length == 0) {
		        // When resolving a conflict "using mine" and there are no more entries in the tables,
		        // show the contextual menu for being able to restart the merging

		        GitStatus status = GitAccess.getInstance().getStatus();
		        if (status.getStagedFiles().isEmpty()
		            && status.getUnstagedFiles().isEmpty()
		            && isMergingResolved()) {
		          showContextualMenuForFlatView(e.getX(), e.getY(), new int[0]);
		        }
		      } else {
		        // ======== RIGHT CLICK ==========
		        showContextualMenuForFlatView(e.getX(), e.getY(), selectedRows);
		      }
		    }
		  }

		});

		filesTable.addKeyListener(new KeyAdapter() {
		  @Override
		  public void keyPressed(KeyEvent e) {
		    if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
		      int[] selectedRows = filesTable.getSelectedRows();
		      if (selectedRows.length > 0) {
		        Rectangle cellRect = filesTable.getCellRect(selectedRows[selectedRows.length - 1], 0, true);
		        showContextualMenuForFlatView(cellRect.x, cellRect.y + cellRect.height, selectedRows);
		      }
		    }
		  }
		});

		// Compare files on enter.
		filesTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
		    .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
		filesTable.getActionMap().put("Enter", new AbstractAction() {
			@Override
      public void actionPerformed(ActionEvent e) {
				int row = filesTable.convertRowIndexToModel(filesTable.getSelectedRow());
				if (row != -1) {
					openFileInCompareEditor(row);
				}
			}
		});

		scrollPane = new JScrollPane(filesTable);
		scrollPane.add(tree);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setPreferredSize(new Dimension(200, 200));
		filesTable.setFillsViewportHeight(true);
		this.add(scrollPane, gbc);

		setResourcesViewMode(currentViewMode);
	}

Replace Anonymous With Lambda com.oxygenxml.git.view.ChangesPanel.addFilesPanel.addListSelectionListener.new ListSelectionListener with e -> {if(!e.getValueIsAdjusting()){toggleSelectedButton(); in method private addFilesPanel(gbc GridBagConstraints) : void from class com.oxygenxml.git.view.ChangesPanel


	/**
	 * Adds a listener on the switchView button: When clicked the current view
	 * will change. Also the selected files will be selected in the new view (the
	 * selection is preserved between the view changes)
	 */
	private void addSwitchViewButtonListener() {
		switchViewButton.addActionListener(e -> {
    	setResourcesViewMode(currentViewMode == ResourcesViewMode.FLAT_VIEW ?
    	    ResourcesViewMode.TREE_VIEW : ResourcesViewMode.FLAT_VIEW);
    	isContextMenuShowing = false;
    });
	}

	/**
	 * Adds a listener on the switchView button: When clicked the current view
	 * will change. Also the selected files will be selected in the new view (the
	 * selection is preserved between the view changes)
	 */
	private void addSwitchButtonListener() {
		switchViewButton.addActionListener(new ActionListener() {
			@Override
      public void actionPerformed(ActionEvent e) {
				setResourcesViewMode(currentViewMode == ResourcesViewMode.FLAT_VIEW ?
				    ResourcesViewMode.TREE_VIEW : ResourcesViewMode.FLAT_VIEW);
				isContextMenuShowing = false;
			}
		});
	}

Replace Anonymous With Lambda com.oxygenxml.git.view.ChangesPanel.addSwitchButtonListener.addActionListener.new ActionListener with e -> {setResourcesViewMode(currentViewMode == ResourcesViewMode.FLAT_VIEW ? ResourcesViewMode.TREE_VIEW : ResourcesViewMode.FLAT_VIEW); in method private addSwitchViewButtonListener() : void from class com.oxygenxml.git.view.ChangesPanel


  /**
   * @return "Continue rebase" action listener.
   */
  private ActionListener createContinueActionListener() {
    return e -> {
      setVisible(false);
      GitAccess.getInstance().continueRebase();
    };
  }

  /**
   * @return "Continue rebase" action listener.
   */
  private ActionListener createContinueActionListener() {
    return new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        setVisible(false);
        GitAccess.getInstance().continueRebase();
      }
    };
  }

Replace Anonymous With Lambda com.oxygenxml.git.view.dialog.RebaseInProgressDialog.createContinueActionListener.new ActionListener with e -> {setVisible(false); in method private createContinueActionListener() : ActionListener from class com.oxygenxml.git.view.dialog.RebaseInProgressDialog


  /**
   * @return "Abort rebase" action listener.
   */
  private ActionListener createAbortRebaseActionListener() {
    return e -> {
      setVisible(false);
      GitAccess.getInstance().abortRebase();
    };
  }

  /**
   * @return "Abort rebase" action listener.
   */
  private ActionListener createAbortRebaseActionListener() {
    return new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        setVisible(false);
        GitAccess.getInstance().abortRebase();
      }
    };
  }

Replace Anonymous With Lambda com.oxygenxml.git.view.dialog.RebaseInProgressDialog.createAbortRebaseActionListener.new ActionListener with e -> {setVisible(false); in method private createAbortRebaseActionListener() : ActionListener from class com.oxygenxml.git.view.dialog.RebaseInProgressDialog


  /**
   * @return Cancel action listener.
   */
  private ActionListener createCancelActionListener() {
    return e -> setVisible(false);
  }

  /**
   * @return Cancel action listener.
   */
  private ActionListener createCancelActionListener() {
    return new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        setVisible(false);
      }
    };
  }

Replace Anonymous With Lambda com.oxygenxml.git.view.dialog.RebaseInProgressDialog.createCancelActionListener.new ActionListener with e -> setVisible(false) in method private createCancelActionListener() : ActionListener from class com.oxygenxml.git.view.dialog.RebaseInProgressDialog


          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            return fileStatuses;
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            return fileStatuses;
          }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getAllSelectedResources() : List<FileStatus> from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest.testActionsEnablingState_1.menu.new GitViewResourceContextualMenu.new SelectedResourcesProvider


/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_1() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        RepositoryState.SAFE);

    assertEquals("\n" +
        "Open_In_Compare [ENABLED]\n" +
        "Open [ENABLED]\n" +
        "Unstage [ENABLED]\n" +
        "Resolve_Conflict [DISABLED]\n" +
        "  Open_In_Compare [ENABLED]\n" +
        "  ----\n" +
        "  Resolve_Using_Mine [DISABLED]\n" +
        "  Resolve_Using_Theirs [DISABLED]\n" +
        "  Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Restart_Merge [DISABLED]\n" +
        "Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_1() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        false);

    assertEquals("\n" +
        "Contextual_Menu_Open_In_Compare [ENABLED]\n" +
        "Contextual_Menu_Open [ENABLED]\n" +
        "Contextual_Menu_Unstage [ENABLED]\n" +
        "Contextual_Menu_Resolve_Conflict [DISABLED]\n" +
        "  Contextual_Menu_Open_In_Compare [ENABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Resolve_Using_Mine [DISABLED]\n" +
        "  Contextual_Menu_Resolve_Using_Theirs [DISABLED]\n" +
        "  Contextual_Menu_Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Restart_Merge [DISABLED]\n" +
        "Contextual_Menu_Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

Replace Generic With Diamond GitViewResourceContextualMenu with GitViewResourceContextualMenu in method public testActionsEnablingState_1() : void from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest


          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test2.xml"));
            return fileStatuses;
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test2.xml"));
            return fileStatuses;
          }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getAllSelectedResources() : List<FileStatus> from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest.testActionsEnablingState_2.menu.new GitViewResourceContextualMenu.new SelectedResourcesProvider


/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_2() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test2.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        RepositoryState.SAFE);

    assertEquals("\n" +
        "Open_In_Compare [DISABLED]\n" +
        "Open [ENABLED]\n" +
        "Unstage [ENABLED]\n" +
        "Resolve_Conflict [DISABLED]\n" +
        "  Open_In_Compare [DISABLED]\n" +
        "  ----\n" +
        "  Resolve_Using_Mine [DISABLED]\n" +
        "  Resolve_Using_Theirs [DISABLED]\n" +
        "  Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Restart_Merge [DISABLED]\n" +
        "Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_2() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test2.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        false);

    assertEquals("\n" +
        "Contextual_Menu_Open_In_Compare [DISABLED]\n" +
        "Contextual_Menu_Open [ENABLED]\n" +
        "Contextual_Menu_Unstage [ENABLED]\n" +
        "Contextual_Menu_Resolve_Conflict [DISABLED]\n" +
        "  Contextual_Menu_Open_In_Compare [DISABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Resolve_Using_Mine [DISABLED]\n" +
        "  Contextual_Menu_Resolve_Using_Theirs [DISABLED]\n" +
        "  Contextual_Menu_Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Restart_Merge [DISABLED]\n" +
        "Contextual_Menu_Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

Replace Generic With Diamond GitViewResourceContextualMenu with GitViewResourceContextualMenu in method public testActionsEnablingState_2() : void from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest


          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test2.xml"));
            return fileStatuses;
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test2.xml"));
            return fileStatuses;
          }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getAllSelectedResources() : List<FileStatus> from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest.testActionsEnablingState_3.menu.new GitViewResourceContextualMenu.new SelectedResourcesProvider


/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_3() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test2.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        RepositoryState.SAFE);

    assertEquals("\n" +
        "Open_In_Compare [DISABLED]\n" +
        "Open [ENABLED]\n" +
        "Unstage [ENABLED]\n" +
        "Resolve_Conflict [DISABLED]\n" +
        "  Open_In_Compare [DISABLED]\n" +
        "  ----\n" +
        "  Resolve_Using_Mine [DISABLED]\n" +
        "  Resolve_Using_Theirs [DISABLED]\n" +
        "  Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Restart_Merge [DISABLED]\n" +
        "Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

/**
   *
Description: test the enabling state of the actions
   * from the contextual menu of the staged resources.

   *
Bug ID: EXM-40615

   *
   * @author sorin_carbunaru
   *
   * @throws Exception
   */
  public void testActionsEnablingState_3() throws Exception {
    GitViewResourceContextualMenu menu = new GitViewResourceContextualMenu(
        new SelectedResourcesProvider() {
          @Override
          public List<FileStatus> getOnlySelectedLeaves() {
            return getAllSelectedResources();
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.ADD, "test.xml"));
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test2.xml"));
            return fileStatuses;
          }
        },
        stagingCtrl,
        // For staged resources
        true,
        false);

    assertEquals("\n" +
        "Contextual_Menu_Open_In_Compare [DISABLED]\n" +
        "Contextual_Menu_Open [ENABLED]\n" +
        "Contextual_Menu_Unstage [ENABLED]\n" +
        "Contextual_Menu_Resolve_Conflict [DISABLED]\n" +
        "  Contextual_Menu_Open_In_Compare [DISABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Resolve_Using_Mine [DISABLED]\n" +
        "  Contextual_Menu_Resolve_Using_Theirs [DISABLED]\n" +
        "  Contextual_Menu_Mark_Resolved [DISABLED]\n" +
        "  ----\n" +
        "  Contextual_Menu_Restart_Merge [DISABLED]\n" +
        "Contextual_Menu_Discard [ENABLED]",
        PopupMenuSerializer.serializePopupStructure(menu, true, true));
  }

Replace Generic With Diamond GitViewResourceContextualMenu with GitViewResourceContextualMenu in method public testActionsEnablingState_3() : void from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest


          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<>();
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test.xml"));
            return fileStatuses;
          }

          @Override
          public List<FileStatus> getAllSelectedResources() {
            List<FileStatus> fileStatuses = new ArrayList<FileStatus>();
            fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test.xml"));
            return fileStatuses;
          }

Replace Generic With Diamond ArrayList<FileStatus> with ArrayList<> in method public getAllSelectedResources() : List<FileStatus> from class com.oxygenxml.git.view.GitViewResourceContextualMenuActionsTest.testActionsEnablingState_4.menu.new GitViewResourceContextualMenu.new SelectedResourcesProvider