how to remove all items from alist in java

Java
list.clear();
Source

Also in Java: