package humaneval.buggy;

import java.util.ArrayList;

/*
 * Given a positive integer n, you have to make a pile of n levels of stones.
 * The first level has n stones.
 * The number of stones in the next level is:
 * - the next odd number if n is odd.
 * - the next even number if n is even.
 * Return the number of stones in each level in a list, where element at index
 * i represents the number of stones in the level (i+1).
 *
 * Examples:
 * >>> make_a_pile(3)
 * [3, 5, 7]
 */

public class MAKE_A_PILE {
	public static ArrayList<Integer> make_a_pile(int n) {
		ArrayList<Integer> pile = new ArrayList<Integer>();
		for(int i = 0; i < n; i++) {
			pile.add(n - 2 * i);
		}
		return pile;
	}
}

package humaneval;

import java.util.ArrayList;
import java.util.Arrays;

public class TEST_MAKE_A_PILE {
	@org.junit.Test(timeout=3000)
	public void test_0() throws java.lang.Exception {
		ArrayList<Integer> result = humaneval.buggy.MAKE_A_PILE.make_a_pile(3);
		ArrayList<Integer> desired = new ArrayList<Integer>(Arrays.asList(3, 5, 7));
		org.junit.Assert.assertEquals(result, desired);
	}
	public void test_1() throws java.lang.Exception {
		ArrayList<Integer> result = humaneval.buggy.MAKE_A_PILE.make_a_pile(4);
		ArrayList<Integer> desired = new ArrayList<Integer>(Arrays.asList(4, 6, 8, 10));
		org.junit.Assert.assertEquals(result, desired);
	}
	public void test_2() throws java.lang.Exception {
		ArrayList<Integer> result = humaneval.buggy.MAKE_A_PILE.make_a_pile(5);
		ArrayList<Integer> desired = new ArrayList<Integer>(Arrays.asList(5, 7, 9, 11, 13));
		org.junit.Assert.assertEquals(result, desired);
	}
	public void test_3() throws java.lang.Exception {
		ArrayList<Integer> result = humaneval.buggy.MAKE_A_PILE.make_a_pile(6);
		ArrayList<Integer> desired = new ArrayList<Integer>(Arrays.asList(6, 8, 10, 12, 14, 16));
		org.junit.Assert.assertEquals(result, desired);
	}
	public void test_4() throws java.lang.Exception {
		ArrayList<Integer> result = humaneval.buggy.MAKE_A_PILE.make_a_pile(8);
		ArrayList<Integer> desired = new ArrayList<Integer>(Arrays.asList(8, 10, 12, 14, 16, 18, 20, 22));
		org.junit.Assert.assertEquals(result, desired);
	}
}