I have a function myFunction
of Function<Integer, T>
, and I want to construct an object mylist
of size size
, implementing List<T>
(or maybe some kind of immutable list interface), backed by the function, in the sense that mylist.get(i) == myFunction.apply(i)
.
I can do this manually, but is there some (Guava) code which does the same?