private Random rand = new Random();
public void testApiBasics() {
int elemId = rand.nextInt();
Weight w1 = new Weight(elemId, rand.nextInt());
Weight w2 = new Weight(elemId, rand.nextInt());
Weight w3 = new Weight(elemId, rand.nextInt());
assertTrue(w1.equals(w2));
assertTrue(w2.equals(w3));
assertEquals(w1.hashCode(), w2.hashCode());
assertEquals(w2.hashCode(), w3.hashCode());
HashSet<Weight> set1 = new HashSet<Weight>();
set1.add(w1);
set1.add(w2);
set1.add(w3);
assertEquals(1, set1.size());
HashSet<Weight> set2 = new HashSet<Weight>();
set2.add(w1);
set2.add(w2);
set2.add(w3);
Weight w4 = new Weight(++elemId, rand.nextInt());
Weight w5 = new Weight(++elemId, rand.nextInt());
set2.add(w4);
set2.add(w5);
assertEquals(3, set2.size());
List<Weight> list1 = new ArrayList<Weight>();