Find the distinct number from arrays that is greater than 20 using Stream API. ArrayList<Integer> arr=new ArrayList<>(Arrays.asList(12,44,76,11,8,9,9)); List<Integer> result= arr.stream().distinct().filter(n->n<20).collect(Collectors.toList()); result.forEach(s->System.out.println(s)); 2. Count the occurrence of a given character in a string using Stream API. String str = "Better Butter"; String ch=String.valueOf(str.replace(" ",""));