With Java Generics Takes a list of X and returns a list of T that extends or implements X, Sweet!
// the cast is is actually checked via the method API
@SuppressWarnings("unchecked")
public static <T extends X, X> ArrayList<T> convertToClazz(ArrayList<X> from, Class<X> inClazz, Class<T> outClazz) {
ArrayList<T> to = new ArrayList<T>();
for (X data : from) {
to.add((T) data);
}
return to;
}