public void write(final Path path, final Writer<? super T> writer) {
		try {
			final File tempFile = createTempFile("__trial_meter__", ".xml");
			try {
				try (OutputStream out = new FileOutputStream(tempFile)) {
					write(out, writer);
				}

				move(tempFile.toPath(), path, REPLACE_EXISTING);
			} finally {
				deleteIfExists(tempFile.toPath());
			}
		} catch (IOException e) {
			throw new UncheckedIOException(e);
		}
	}
Writes the current {@code TrialMeter} object (the calculated samples +
the parameters) to the given path.

@param path the output path
@param writer the writer of the parameter type
@throws UncheckedIOException if the marshalling fails
jenetics.tool/src/main/java/io/jenetics/tool/trial/TrialMeter.java