@Test
public void testAllocate() {

    final Allocations allocations = new Allocations(Lists.<Allocation>newArrayList());
    // 0123456789|0123456789|0123456789|0123456789|0123456789|0123456789
    // AAAAAAAAAA|BBBBBBBBBB|BBBBBBBBBB|CCCCCCCCCC|CCCCCCCCCC|CCCCCCCCCC
    allocations.allocate(control, 10);
    allocations.allocate(withLogin, 20);
    allocations.allocate(withoutLogin, 30);
    assertEquals(
        "should be three contiguous allocations of various sizes",
        Lists.newArrayList(
            new Allocation(control, 0, 10),
            new Allocation(withLogin, 10, 20),
            new Allocation(withoutLogin, 30, 30)
        ),
        allocations.getAllocations()
    );
}