<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


/**
 * implement method:
 * public static intp[] Lab03.primeFactors(int n)
 * note: you can assume that n&gt;1
 */
public class Lab03primeFactorsTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSimple() {
		assertArrayEquals(new int[]{7}, run(7));
		assertArrayEquals(new int[]{2,5}, run(10));
		assertArrayEquals(new int[]{2,2,5}, run(20));
	}

	@Test
	public void testSmall() {
		assertArrayEquals(new int[]{2}, run(2));
	}	
	
	@Test
	public void testLarge() {
		assertArrayEquals(new int[]{1000000007}, run(1000000007));
		assertArrayEquals(new int[]{10007,10007}, run(10007*10007));
	}

	
	int[] run(int n) {
		return Lab03.primeFactors(n);
	}	
	
}
</pre></body></html>