docs: synchronized JournalSegment<E> getNextSegment() {
      assertOpen();
      assertDiskSpace();
  
      JournalSegment lastSegment = getLastSegment();
      JournalSegmentDescriptor descriptor = JournalSegmentDescriptor.builder()
          .withId(lastSegment != null ? lastSegment.descriptor().id() + 1 : 1)
          .withIndex(currentSegment.lastIndex() + 1)
          .withMaxSegmentSize(maxSegmentSize)
          .withMaxEntries(maxEntriesPerSegment)
          .build();
  
      currentSegment = createSegment(descriptor);
  
      segments.put(descriptor.index(), currentSegment);
      return currentSegment;
    }