// Path: src/main/java/es/cnio/bioinfo/bicycle/gatk/ListerFilter.java
// protected static class CigarIterator implements Iterator<CigarOperator> {
// 
// 	private final boolean reverse;
// 	private List<CigarElement> cigarElements;
// 	private int currentCigarElementsPos;
// 
// 	private int repetitionsOfCurrentOperation = 0;
// 	private CigarOperator currentOperator = null;
// 
// 	public CigarIterator(String cigar, boolean reverse) {
// 		this.cigarElements = new ArrayList(TextCigarCodec.getSingleton().decode(cigar).getCigarElements());
// 		this.reverse = reverse;
// 		this.currentCigarElementsPos = this.reverse ? cigarElements.size() : -1;
// 		this.advanceCigarElement();
// 	}
// 
// 	@Override
// 	public boolean hasNext() {
// 		return repetitionsOfCurrentOperation > 0
// 				|| (this.currentCigarElementsPos >= 0 && this.currentCigarElementsPos < this.cigarElements.size());
// 	}
// 
// 	@Override
// 	public CigarOperator next() {
// 
// 		CigarOperator result = this.currentOperator;
// 		this.repetitionsOfCurrentOperation--;
// 		if (repetitionsOfCurrentOperation == 0 && (this.currentCigarElementsPos >= 0 && this
// 				.currentCigarElementsPos < this.cigarElements.size())) {
// 			advanceCigarElement();
// 		}
// 
// 		return result;
// 	}
// 
// 	private void advanceCigarElement() {
// 		this.currentCigarElementsPos = this.currentCigarElementsPos + (this.reverse ? -1 : 1);
// 		if (this.currentCigarElementsPos >= 0 && this.currentCigarElementsPos < this.cigarElements.size()) {
// 			CigarElement element = this.cigarElements.get(this.currentCigarElementsPos);
// 			this.repetitionsOfCurrentOperation = element.getLength();
// 			this.currentOperator = element.getOperator();
// 		}
// 	}
// }


import static junit.framework.Assert.assertEquals;
import java.io.IOException;
import org.junit.Test;
import es.cnio.bioinfo.bicycle.gatk.ListerFilter.CigarIterator;
import net.sf.samtools.CigarOperator;
package es.cnio.bioinfo.bicycle.gatk;






public class CigarIteratorTest {

	@Test
	public void testPerfectMatch() {
// Path: src/main/java/es/cnio/bioinfo/bicycle/gatk/ListerFilter.java
// protected static class CigarIterator implements Iterator<CigarOperator> {
// 
// 	private final boolean reverse;
// 	private List<CigarElement> cigarElements;
// 	private int currentCigarElementsPos;
// 
// 	private int repetitionsOfCurrentOperation = 0;
// 	private CigarOperator currentOperator = null;
// 
// 	public CigarIterator(String cigar, boolean reverse) {
// 		this.cigarElements = new ArrayList(TextCigarCodec.getSingleton().decode(cigar).getCigarElements());
// 		this.reverse = reverse;
// 		this.currentCigarElementsPos = this.reverse ? cigarElements.size() : -1;
// 		this.advanceCigarElement();
// 	}
// 
// 	@Override
// 	public boolean hasNext() {
// 		return repetitionsOfCurrentOperation > 0
// 				|| (this.currentCigarElementsPos >= 0 && this.currentCigarElementsPos < this.cigarElements.size());
// 	}
// 
// 	@Override
// 	public CigarOperator next() {
// 
// 		CigarOperator result = this.currentOperator;
// 		this.repetitionsOfCurrentOperation--;
// 		if (repetitionsOfCurrentOperation == 0 && (this.currentCigarElementsPos >= 0 && this
// 				.currentCigarElementsPos < this.cigarElements.size())) {
// 			advanceCigarElement();
// 		}
// 
// 		return result;
// 	}
// 
// 	private void advanceCigarElement() {
// 		this.currentCigarElementsPos = this.currentCigarElementsPos + (this.reverse ? -1 : 1);
// 		if (this.currentCigarElementsPos >= 0 && this.currentCigarElementsPos < this.cigarElements.size()) {
// 			CigarElement element = this.cigarElements.get(this.currentCigarElementsPos);
// 			this.repetitionsOfCurrentOperation = element.getLength();
// 			this.currentOperator = element.getOperator();
// 		}
// 	}
// }


// Path: src/test/java/es/cnio/bioinfo/bicycle/gatk/CigarIteratorTest.java
import static junit.framework.Assert.assertEquals;
import java.io.IOException;
import org.junit.Test;
import es.cnio.bioinfo.bicycle.gatk.ListerFilter.CigarIterator;
import net.sf.samtools.CigarOperator;

package es.cnio.bioinfo.bicycle.gatk;






public class CigarIteratorTest {

	@Test
	public void testPerfectMatch() {
		CigarIterator iterator = new CigarIterator("3M", false);