// Path: Random Regex Turtle/src/it/units/inginf/male/utils/Range.java
// public class Range implements Comparable<Range>{
//     private int startIndex;
//     private int endIndex;
// 
//     public Range(int startIndex, int endIndex) {
//         this.startIndex = startIndex;
//         this.endIndex = endIndex;
//     }
// 
//     /**
//      * The index of the first row (inclusive) of the range
//      * @return the index
//      */
//     public int getEndIndex() {
//         return endIndex;
//     }
// 
//     /**
//      * The index of the last row (inclusive) of the range
//      * @return the index
//      */
//     public int getStartIndex() {
//         return startIndex;
//     }
// 
// 
//     public int getLength(){
//         return endIndex-startIndex+1;
//     }
//     
//     /**
//      * Merges ranges in order to obtain a more compact representation. This is intended to work with no-overlapping Ranges.
//      * Behavior with overlapping ranges is undefined.
//      * @param ranges
//      * @return
//      */
//     static public List<Range> compactRanges(List<Range> ranges){
//         List<Range> newRanges = new LinkedList<>();
//         if(ranges.isEmpty()){
//             return newRanges;
//         }
//         
//         Collections.sort(ranges);
//         Range prevRange = new Range(ranges.get(0).startIndex, ranges.get(0).endIndex);
//         for (int i = 1; i < ranges.size(); i++) {
//             Range currentRange = ranges.get(i);
//             if(currentRange.startIndex == prevRange.endIndex+1){
//                 //merge
//                 prevRange.endIndex = currentRange.endIndex;
//             } else {
//                 newRanges.add(prevRange);
//                 prevRange = new Range(currentRange.startIndex, currentRange.endIndex);
//             }
//         }
//         newRanges.add(prevRange);
//         return newRanges;
//     }
// 
//     @Override
//     public int compareTo(Range o) {
//        return (this.startIndex - o.startIndex);
//     }
//     
//     
// }


import it.units.inginf.male.utils.Range;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
         * All chars are going to be annotated. 
         */
        public void populateUnmatchesFromMatches(){
            this.unmatch.clear();
            //generate unmatches
                int previousMatchFinalIndex = 0;
                for(DataSet.Bounds oneMatch : this.match){
                    if(oneMatch.start > previousMatchFinalIndex){
                        this.addUnmatchBounds(previousMatchFinalIndex, oneMatch.start);
                    }
                    previousMatchFinalIndex = oneMatch.end;
                }
                if(previousMatchFinalIndex < string.length()){
                    /*
                    the right value of the interval can be equal than the string.lenght
                    because the substrings are left-inclusive and right-exclusive
                    */
                    this.addUnmatchBounds(previousMatchFinalIndex, string.length());
                }
        }

        public int getNumberMatches() {
            return this.match.size();
        }
        
        /**
         * Returns the annotated strings, matches and unmatches
         * @return a list of all annotated strings
         */
        public List<String> getAnnotatedStrings(){
// Path: Random Regex Turtle/src/it/units/inginf/male/utils/Range.java
// public class Range implements Comparable<Range>{
//     private int startIndex;
//     private int endIndex;
// 
//     public Range(int startIndex, int endIndex) {
//         this.startIndex = startIndex;
//         this.endIndex = endIndex;
//     }
// 
//     /**
//      * The index of the first row (inclusive) of the range
//      * @return the index
//      */
//     public int getEndIndex() {
//         return endIndex;
//     }
// 
//     /**
//      * The index of the last row (inclusive) of the range
//      * @return the index
//      */
//     public int getStartIndex() {
//         return startIndex;
//     }
// 
// 
//     public int getLength(){
//         return endIndex-startIndex+1;
//     }
//     
//     /**
//      * Merges ranges in order to obtain a more compact representation. This is intended to work with no-overlapping Ranges.
//      * Behavior with overlapping ranges is undefined.
//      * @param ranges
//      * @return
//      */
//     static public List<Range> compactRanges(List<Range> ranges){
//         List<Range> newRanges = new LinkedList<>();
//         if(ranges.isEmpty()){
//             return newRanges;
//         }
//         
//         Collections.sort(ranges);
//         Range prevRange = new Range(ranges.get(0).startIndex, ranges.get(0).endIndex);
//         for (int i = 1; i < ranges.size(); i++) {
//             Range currentRange = ranges.get(i);
//             if(currentRange.startIndex == prevRange.endIndex+1){
//                 //merge
//                 prevRange.endIndex = currentRange.endIndex;
//             } else {
//                 newRanges.add(prevRange);
//                 prevRange = new Range(currentRange.startIndex, currentRange.endIndex);
//             }
//         }
//         newRanges.add(prevRange);
//         return newRanges;
//     }
// 
//     @Override
//     public int compareTo(Range o) {
//        return (this.startIndex - o.startIndex);
//     }
//     
//     
// }


// Path: Random Regex Turtle/src/it/units/inginf/male/inputs/DataSet.java
import it.units.inginf.male.utils.Range;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

         * All chars are going to be annotated. 
         */
        public void populateUnmatchesFromMatches(){
            this.unmatch.clear();
            //generate unmatches
                int previousMatchFinalIndex = 0;
                for(DataSet.Bounds oneMatch : this.match){
                    if(oneMatch.start > previousMatchFinalIndex){
                        this.addUnmatchBounds(previousMatchFinalIndex, oneMatch.start);
                    }
                    previousMatchFinalIndex = oneMatch.end;
                }
                if(previousMatchFinalIndex < string.length()){
                    /*
                    the right value of the interval can be equal than the string.lenght
                    because the substrings are left-inclusive and right-exclusive
                    */
                    this.addUnmatchBounds(previousMatchFinalIndex, string.length());
                }
        }

        public int getNumberMatches() {
            return this.match.size();
        }
        
        /**
         * Returns the annotated strings, matches and unmatches
         * @return a list of all annotated strings
         */
        public List<String> getAnnotatedStrings(){
            List<String> annotatedStrings = new LinkedList<>();