Java, Java8, Java21, Java17, Migration.
concise and expressive manner. List<String> fruits = Arrays.asList("apple", "banana", "orange", "grape", "kiwi"); // Using Stream API to filter and transform elements List<String> result = fruits.stream() .filter(fruit -> fruit.length() > 5) .map(String::toUpperCase) .collect(Collectors.toList());