I was expecting ClassCastExpection when running this code in Java 11 but it executes without an issue is there an explanation for this case?
List<?> list = List.of(new HashMap<>());
List<String> listOfStrings = (List<String>) list;
System.out.println("List size: " + listOfStrings.size());