Příklad

public static void main(String[] args) {
List l = new ArrayList();
for ( int i = 0; i < args.length; i ++){
l.add( args[ i ] );
}
}

Řešení
Kolekce obrazce se specifickou výchozí velikostí.

public static void main(String[] args) {
List l = new ArrayList( args.length );
for ( int i = 0; i < args.length; i ++){
l.add( args[ i ] );
}
}