Question 12
Method Optional.ofNullable(T value) returns an Optional describing the specified value, if non-null, otherwise returns an empty Optional. Based on this description, consider the code given below, and answer the question that follows.
import java.util.*;class GrindingMachine { String brand; String powerSource; public GrindingMachine(String b, String pS) { this.brand = b; this.powerSource = pS; }}public class Test { public static void main(String[] args) { var machineList = new ArrayList<GrindingMachine>(); machineList.add(new GrindingMachine("Bosch", "Electric")); machineList.add(new GrindingMachine("Hitachi", null)); for (GrindingMachine obj : machineList) { Optional<String> op1 = Optional.ofNullable(obj.powerSource); op1.ifPresent(source -> System.out.println(source)); } }}Choose the correct option.