String (@Nullable String source, @NotNull String value, boolean asPrefix) { if (StringUtil.isEmpty(source)) return value; Set<String> paths = Sets.newHashSet(source.split(File.pathSeparator)); if (!paths.contains(value)) { if (asPrefix) { return value + File.pathSeparator + source; } else { return source + File.pathSeparator + value; } } else { return source; } }