// Path: core/src/main/java/ru/cheremin/scalarization/Scenario.java
// public interface Scenario {
// 	public long run();
// }
// 
// Path: junit-integration/src/main/java/ru/cheremin/scalarization/junit/AllocationMatcher.java
// public static AllocationMatcher finallyAllocatesNothing() {
// 	return finalIteration( new IterationAllocatesNothingMatcher() );
// }
// 
// Path: junit-integration/src/main/java/ru/cheremin/scalarization/junit/AllocationMatcher.java
// public static AllocationMatcher finallyAllocatesSomething() {
// 	return finalIteration( new IterationAllocatesSomethingMatcher() );
// }


import java.util.*;
import org.junit.Test;
import ru.cheremin.scalarization.Scenario;
import static org.junit.Assert.assertThat;
import static ru.cheremin.scalarization.junit.AllocationMatcher.finallyAllocatesNothing;
import static ru.cheremin.scalarization.junit.AllocationMatcher.finallyAllocatesSomething;
	@Test
	public void arraysAsListAccessedByIndexIsScalarized() throws Exception {
		assertThat(
				new Scenario() {
					@Override
					public long run() {
						final List<Integer> list = Arrays.asList( ARRAY );
						long sum = 0;
						for( int i = 0; i < list.size(); i++ ) {
							final Integer n = list.get( i );
							sum += n;
						}
						return sum;
					}
				},
				finallyAllocatesNothing()
		);
	}

	@Test
	public void arraysAsListAccessedByIteratorIsNOTScalarized() throws Exception {
		assertThat(
				new Scenario() {
					@Override
					public long run() {
						final List<Integer> list = Arrays.asList( ARRAY );
						long sum = 0;
						for( final Integer n : list ) {
							sum += n;
						}
// Path: core/src/main/java/ru/cheremin/scalarization/Scenario.java
// public interface Scenario {
// 	public long run();
// }
// 
// Path: junit-integration/src/main/java/ru/cheremin/scalarization/junit/AllocationMatcher.java
// public static AllocationMatcher finallyAllocatesNothing() {
// 	return finalIteration( new IterationAllocatesNothingMatcher() );
// }
// 
// Path: junit-integration/src/main/java/ru/cheremin/scalarization/junit/AllocationMatcher.java
// public static AllocationMatcher finallyAllocatesSomething() {
// 	return finalIteration( new IterationAllocatesSomethingMatcher() );
// }


// Path: junit-integration/src/test/java/ru/cheremin/scalarization/lab/collections/ArrayAsListTest.java
import java.util.*;
import org.junit.Test;
import ru.cheremin.scalarization.Scenario;
import static org.junit.Assert.assertThat;
import static ru.cheremin.scalarization.junit.AllocationMatcher.finallyAllocatesNothing;
import static ru.cheremin.scalarization.junit.AllocationMatcher.finallyAllocatesSomething;

	@Test
	public void arraysAsListAccessedByIndexIsScalarized() throws Exception {
		assertThat(
				new Scenario() {
					@Override
					public long run() {
						final List<Integer> list = Arrays.asList( ARRAY );
						long sum = 0;
						for( int i = 0; i < list.size(); i++ ) {
							final Integer n = list.get( i );
							sum += n;
						}
						return sum;
					}
				},
				finallyAllocatesNothing()
		);
	}

	@Test
	public void arraysAsListAccessedByIteratorIsNOTScalarized() throws Exception {
		assertThat(
				new Scenario() {
					@Override
					public long run() {
						final List<Integer> list = Arrays.asList( ARRAY );
						long sum = 0;
						for( final Integer n : list ) {
							sum += n;
						}
						return sum;