code: static <T> Function<Integer, T> fromList(
          final List<T> list, T defaultValue)
      {
          return new Function<Integer, T>()
          {
              @Override
              public T apply(Integer i)
              {
                  if (i >= 0 && i<list.size())
                  {
                      return list.get(i);
                  }
                  return defaultValue;
              }
          };
      }
docs: Creates a new <code>Function</code> from the given list. <br>
  <br>
  The function will use given integer argument as the index for
  the list. If the given integer argument is not in bounds, then
  the given default value will be returned.<br>
  <br>
  The function will be a <i>view</i> on the given list. So changes in
  the list will be visible via the returned function.
  
  @param <T> The value type
  @param list The list
  @param defaultValue The default value that will be returned when
  the index that is given as the function argument is out of bounds.
  @return The {@link Function}