This would be very handy, since typecasting gets boring quickly.
If you are using generics (java 5) you can avoid all castings with
List<String> myList = new ArrayList<String>(); myList.add(" a test"); String temp = myList.get(0);
If I am missing something in your question that should cover both needs.
I don't understand what is so hard:
List<Foo> fooList = new ArrayList<Foo>();
I think you could define a class:
public class FooList extends ArrayList<Foo> { ... }
if you want to avoid angle brackets ...
If in the variable "length length" you change size over time, then you most likely need a LinkedList, not an ArrayList:
print("List<Foo> fooList = new LinkedList<Foo>();");
This way you get the best performance when adding a group of items.