Java Lambda create a filter with a predicate function which determines if the Levenshtine distnace is greater than 2 : With my low knowledge in lambda, I would appreciate if someone could help me to change my "query". I have a query to get the most similar value. Well I need to define the minimum  Levenshtine distnace result. If the score is more than 2, I don't want to see the value as part of the recommendation. 
    	
    String recommendation =  candidates.parallelStream()
				.map(String::trim) 
				.filter(s -> !s.equals(search))
				.min((a, b) -> Integer.compare(
			      cache.computeIfAbsent(a, k -> StringUtils.getLevenshteinDistance(Arrays.stream(search.split(" ")).sorted().toString(), Arrays.stream(k.split(" ")).sorted().toString()) ),
			      cache.computeIfAbsent(b, k -> StringUtils.getLevenshteinDistance(Arrays.stream(search.split(" ")).sorted().toString(), Arrays.stream(k.split(" ")).sorted().toString()))))
			    .get();

Thank you!