Source:
<code>public Map<String, String> retrieveMavenProperties() throws IOException { Map<String, String> res = new HashMap<>(mavenProperties); if ( StringUtils.isNotBlank( mavenPropertiesFile )) { File file = new File (mavenPropertiesFile); if (file.exists() && file.isFile()) { try(FileInputStream fileInputStream = new FileInputStream(file)) { Properties properties = new Properties( ); properties.load( fileInputStream ); for (Map.Entry<Object,Object> entry : properties.entrySet()) { res.put((String) entry.getKey(), (String) entry.getValue()); } } } else { throw new IOException("Extra Maven Properties File " + mavenPropertiesFile + " does not exist or not a File" ); } } if (testJDKHome != null) { if (!testJDKHome.exists() || !testJDKHome.isDirectory()) { throw new IOException("Wrong Test JDK Home passed as a parameter: " + testJDKHome); } if (res.containsKey("jvm")) { System.out.println("WARNING: Maven properties already contain the 'jvm' argument. " + "Overriding the previous Test JDK home value '" + res.get("jvm") + "' by the explicit argument: " + testJDKHome); } else { System.out.println("Using custom Test JDK home: " + testJDKHome); } final String javaCmdAbsolutePath = new File(testJDKHome, "bin/java").getAbsolutePath(); res.put("jvm", javaCmdAbsolutePath); <START> res.put("javaVersion", getJavaVersion(javaCmdAbsolutePath)); <END> } if (StringUtils.isNotBlank(testJavaArgs)) { if (res.containsKey("argLine")) { System.out.println("WARNING: Maven properties already contain the 'argLine' argument. " + "Merging value from properties and from the command line"); res.put("argLine", res.get("argLine") + " " + testJavaArgs); } else { res.put("argLine", testJavaArgs); } } return res; }</code><technical_language>approach lead setting property in Maven executions. want introduce a new method instead</technical_language>

Target:
public Map<String, String> retrieveMavenProperties() throws IOException { Map<String, String> res = new HashMap<>(mavenProperties); if ( StringUtils.isNotBlank( mavenPropertiesFile )) { File file = new File (mavenPropertiesFile); if (file.exists() && file.isFile()) { try(FileInputStream fileInputStream = new FileInputStream(file)) { Properties properties = new Properties( ); properties.load( fileInputStream ); for (Map.Entry<Object,Object> entry : properties.entrySet()) { res.put((String) entry.getKey(), (String) entry.getValue()); } } } else { throw new IOException("Extra Maven Properties File " + mavenPropertiesFile + " does not exist or not a File" ); } } if (testJDKHome != null) { if (!testJDKHome.exists() || !testJDKHome.isDirectory()) { throw new IOException("Wrong Test JDK Home passed as a parameter: " + testJDKHome); } if (res.containsKey("jvm")) { System.out.println("WARNING: Maven properties already contain the 'jvm' argument. " + "Overriding the previous Test JDK home value '" + res.get("jvm") + "' by the explicit argument: " + testJDKHome); } else { System.out.println("Using custom Test JDK home: " + testJDKHome); } final String javaCmdAbsolutePath = getTestJavaCommandPath(); res.put("jvm", javaCmdAbsolutePath); } if (StringUtils.isNotBlank(testJavaArgs)) { if (res.containsKey("argLine")) { System.out.println("WARNING: Maven properties already contain the 'argLine' argument. " + "Merging value from properties and from the command line"); res.put("argLine", res.get("argLine") + " " + testJavaArgs); } else { res.put("argLine", testJavaArgs); } } return res; }