Re: Generic and ArrayList
Your choice of the class name, Generic, makes this hard to discuss. First, you should declare your List as ArrayList<Generic<Double>> since Generic is a generic type (ugh!). Then you can just do this:
for any type T and you won't get a class cast exception. However, suppose you had declared List to be ArrayList<Foo> which doesn't have a getNumber method, visible or not. How would the use of your method distinguish between the two list forms? If you are going to expect your method to support a specific method of a generic class, then use an interface and incorporate it into the type parameter with an extends.
T g = list.get(i);