code: public ByteBuffer getElement(ByteBuffer serializedList, int index)
      {
          try
          {
              ByteBuffer input = serializedList.duplicate();
              int n = readCollectionSize(input, Server.VERSION_3);
              if (n <= index)
                  return null;
  
              for (int i = 0; i < index; i++)
              {
                  int length = input.getInt();
                  input.position(input.position() + length);
              }
              return readValue(input, Server.VERSION_3);
          }
          catch (BufferUnderflowException e)
          {
              throw new MarshalException("Not enough bytes to read a list");
          }
      }
docs: Returns the element at the given index in a list.
  @param serializedList a serialized list
  @param index the index to get
  @return the serialized element at the given index, or null if the index exceeds the list size