public final Thread<T> newThread(Object id, final ProgramCounter<T> programCounter, final List<? extends T> items, final int itemPointer, final Map<Object, CaptureGroup<T>> captureGroups, final Map<Object, Object> variables) {
final String className = this.getClass().getName();
final Logger logger = Logger.getLogger(className);
final boolean finer = logger != null && logger.isLoggable(Level.FINER);
if (finer) {
logger.entering(className, "newThread", new Object[] { id, programCounter, items, itemPointer, captureGroups, variables });
}
if (id == null) {
id = String.format("T%d", this.idGenerator.getAndIncrement());
}
final Thread<T> returnValue = new Thread<T>(id, programCounter, items, itemPointer, captureGroups, variables, this);