code: @SuppressWarnings("unchecked")
      @Override
      public E get(int index) {
          stateLock.readLock().lock();
          try {
              switch (state) {
                  case BLOCKING:
                      if (waitForIndex(index)) {
                          return (E) elements[index];
                      }
                      // FALL THROUGH because waitForIndex() returned false and this list is now timed out
                  case TIMED_OUT:
                      // FALL THROUGH because TIMED_OUT and COMPLETE_WITH_FAILURES both involve missing elements
                  case COMPLETE_WITH_FAILURES:
                      return (E) elements[effectiveIndex[index]];
                  case COMPLETE:
                      return (E) elements[index];
                  default:
                      throw new IllegalStateException();
              }
          } finally {
              stateLock.readLock().unlock();
          }
      }
docs: Block until the element at <code>index</code> becomes available or the
  remaining timeout is exceeded.
  <p>
  If the timeout is exceeded, this list will behave as a smaller list
  with only the available elements in it. This method converts the
  supplied index into the appropriate one to use if the timed-out behaviour
  is in effect.
  <p>
  If the timeout is reached this method will also modify the state of the list
  to {@link State#TIMED_OUT}.
  
  @return true if the element arrived, false otherwise