### Question:
JjtreeProgramInvoker extends AbstractProgramInvoker { @Override public ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments) { ProgramArguments augmentedArguments = new ProgramArguments(arguments); augmentedArguments.add("JJTREE_OUTPUT_DIRECTORY", inputRelativePath.getFile(tempOutputDirectory).getParentFile().getAbsolutePath()); return augmentedArguments; } JjtreeProgramInvoker(Project project, Configuration classpath, File tempOutputDirectory); @Override ProgramArguments augmentArguments(File inputDirectory, RelativePath inputRelativePath, ProgramArguments arguments); @Override String getProgramName(); @Override String supportedSuffix(); static final String SUPPORTED_FILE_SUFFIX; }### Answer:
@Test public void augmentArgumentsAppendsJjtreeOutputDirectory() throws IOException { File inputDirectory = testFolder.newFolder("input"); RelativePath fileToCompile = new RelativePath(true, "MyClass.jjt"); ProgramArguments augmentedArguments = programInvoker.augmentArguments(inputDirectory, fileToCompile, new ProgramArguments()); String expectedOutputDirectoryArgument = String.format("-JJTREE_OUTPUT_DIRECTORY=%s", tempOutputDirectory.getAbsolutePath()); assertThat(augmentedArguments.get(augmentedArguments.size() - 1), is(equalTo(expectedOutputDirectoryArgument))); }