### Question:
KerberosUtils { public File getKinitPath(File kinit) { if (kinit != null) { if (FileUtils.canExecute(kinit.toString())) { return kinit; } else { throw new IllegalArgumentException("The kinit path could not be found or is not executable"); } } if( processRunner.runScript("which", Arrays.asList("kinit") ) ) { String pathFromWhich = StringUtils.chomp(processRunner.getOutputFromLastCommand()); return new File(pathFromWhich); } kinit = new File("/usr/bin/kinit"); if (FileUtils.canExecute(kinit.toString())) { return kinit; } return null; }  File getKinitPath(File kinit);  }### Answer:
@Test public void testKinitPathFind() { Assume.assumeTrue("this test requires kerberos properties set kerberos enabled", kerberosSparkProperties.isKerberosEnabled()); File foundScript = kerberosUtils.getKinitPath(DEFAULT_KINIT_PATH); assertThat(foundScript).isEqualTo(DEFAULT_KINIT_PATH); logger.info("'/usr/bin/kinit' found by getKinitPath"); if (processRunner.runScript("which", Arrays.asList("kinit"))) { String pathFromWhich = StringUtils.chomp(processRunner.getOutputFromLastCommand()); File actualResultOfWhich = new File(pathFromWhich); logger.debug("actualResultOfWhich='{}'", actualResultOfWhich); foundScript = kerberosUtils.getKinitPath(null); assertThat(foundScript).isEqualTo(actualResultOfWhich); logger.info("kinit was found using which"); assertThat(kerberosSparkProperties.getKinitPath()).isEqualTo(actualResultOfWhich); } }