FilenameFilter (@NotNull FilenameFilter filter, boolean defaultValue) { return (dir, name) -> { try { return filter.accept(dir, name); } catch (Throwable e) { LOG.error(e); return defaultValue; } }; }