@Test
public void testClear() {

    Treatment t1, t2;
    try {
        t1 = new Treatment("control");
        t2 = new Treatment("other");
    } catch (ValidationException e) {
        // this should never happen
        t1 = null;
        t2 = null;
    }
    final  Allocations allocations = new Allocations(Lists.newArrayList(
        new Allocation(t1, 0, 5),
        new Allocation(t2, 5, 5)
    ));
    assertEquals(2, allocations.getAllocations().size());
    assertEquals(10, allocations.getSize());
    allocations.clear();
    assertEquals(0, allocations.getAllocations().size());
    assertEquals(0, allocations.getSize());
}