class ScanTask implements Runnable {

    @Override
    public void run() {
        output.getParentFile().mkdirs();
        try (final OutputStream stream = new FileOutputStream(output)) {
            final Properties properties = new Properties();
            properties.setProperty("classes.list", scanList().collect(joining(",")));
            properties.store(stream, "generated by " + getClass() + " at " + new Date());
        } catch (final IOException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }

}