code: public static FileOutputStream openExampleFileOuputStream(String filename)
  			throws IOException {
  		Path directoryPath;
  		if ("".equals(lastDumpFileName)) {
  			directoryPath = Paths.get(EXAMPLE_OUTPUT_DIRECTORY);
  		} else {
  			directoryPath = Paths.get(EXAMPLE_OUTPUT_DIRECTORY);
  			createDirectory(directoryPath);
  			directoryPath = directoryPath.resolve(
  					lastDumpFileName);
  		}
  
  		createDirectory(directoryPath);
  		Path filePath = directoryPath.resolve(filename);
  		return new FileOutputStream(filePath.toFile());
  	}
docs: Opens a new FileOutputStream for a file of the given name in the example
  output directory ({@link ExampleHelpers#EXAMPLE_OUTPUT_DIRECTORY}). Any
  file of this name that exists already will be replaced. The caller is
  responsible for eventually closing the stream.
  
  @param filename
  the name of the file to write to
  @return FileOutputStream for the file
  @throws IOException
  if the file or example output directory could not be created