@Override
    public E next() {
      return next(Long.MAX_VALUE);
    }
Check if the given index is valid. An index is valid if it is between {@link
ConcurrentIterableLinkedQueue#firstIndex} and {@link ConcurrentIterableLinkedQueue#tailIndex}.
If the queue is empty, the given index is valid if it is equal to {@link
ConcurrentIterableLinkedQueue#firstIndex}.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/ConcurrentIterableLinkedQueue.java