import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class SolutionTest {
	private Solution solution;

	@Before
	public void setUp() {
		solution = new Solution();
	}

	@Test
	public void oneElement() {
		int[] nums = {1};

		int profit = solution.maxProfit(nums);

		Assert.assertEquals(0, profit);
	}
}

@@ -323,11 +323,176 @@
 fit);%0A%09%7D
+%0A%0A%09@Test%0A%09public void example() %7B%0A%09%09int%5B%5D nums = %7B4, 3, 6, 7, 8, 9, 10, 4, 6, 3, 9%7D;%0A%0A%09%09int profit = solution.maxProfit(nums);%0A%0A%09%09Assert.assertEquals(15, profit);%0A%09%7D
 %0A%7D%0A

add a case for buy and sell stock 2