<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package edu.cornell.cs.cs2110;

import org.junit.Test;
import static org.junit.Assert.*;


public class SmallSetTest {
	@Test public void testEmptySetSize() {
		SmallSet s = new SmallSet();
		assertEquals(0, s.size());
	}

	@Test public void testAddOne() {
		SmallSet s = new SmallSet();
		s.add(new Object());
		assertEquals(1, s.size());
	}
	
	@Test public void testAddAlreadyInSet() {
		SmallSet s = new SmallSet();
		Object o = new Object();
		s.add(o);
		s.add(o);
		assertEquals(1, s.size());
	}

	@Test public void testAddTooMany() {
		SmallSet s = new SmallSet();
		for (int i=0; i &lt; SmallSet.MAX; i++) {
			s.add(new Object());
		}
		try {
			s.add(new Object());
			fail("SmallSetFullException expected");
		}
		catch (SmallSetFullException e) {}
	}
}</pre></body></html>