@Test
public void testSet() {

	int insertSize = 17;
	int boundSize = 5;
	Integer defaultElement = 4711;
	List<Integer> reference = new ArrayList<>(insertSize);
	EvictingBoundedList<Integer> list = new EvictingBoundedList<>(boundSize, defaultElement);
	for (int i = 0; i < insertSize; ++i) {
		reference.add(i);
		list.add(i);
	}
	assertEquals(reference.size(), list.size());
	list.set(0, 123);
	list.set(insertSize - boundSize - 1, 123);
	list.set(insertSize - boundSize, 42);
	reference.set(insertSize - boundSize, 42);
	list.set(13, 43);
	reference.set(13, 43);
	list.set(16, 44);
	reference.set(16, 44);
	try {
		list.set(insertSize, 23);
		fail("Illegal index in set not detected.");
	} catch (IllegalArgumentException ignored) {
	}
	for (int i = 0; i < insertSize; ++i) {
		int exp = i < (insertSize - boundSize) ? defaultElement : reference.get(i);
		int act = list.get(i);
		assertEquals(exp, act);
	}
	assertEquals(reference.size(), list.size());
}