ThreadFactory (final @NonNls @NotNull String name, final boolean isDaemon, final int priority) { return r -> { Thread thread = new Thread(r, name); thread.setDaemon(isDaemon); thread.setPriority(priority); return thread; }; }