Set<String> () { Set<String> result = new TreeSet<>(); for (Supplier<? extends Set<String>> action : myFinders) { try { result.addAll(action.get()); } catch (ProcessCanceledException e) { throw e; } catch (Exception e) { log.warn("Failed to find Java Home. " + e.getMessage(), e); } } return result; }