@Test
public void testAddAllocation() {

  LegacyAllocationConverter converter = new LegacyAllocationConverter();
  int id = converter.addClassName(CLASS_NAME);
  converter.addAllocation(new LegacyAllocationConverter.Allocation(id, SIZE, THREAD_ID, STACK_ID));
  List<AllocationEvent.Allocation> allocations = converter.getAllocationEvents();
  assertThat(allocations.size()).isEqualTo(1);
  assertThat(allocations.get(0).getClassTag()).isEqualTo(id);
  assertThat(allocations.get(0).getSize()).isEqualTo(SIZE);
  assertThat(allocations.get(0).getThreadId()).isEqualTo(THREAD_ID);
  assertThat(allocations.get(0).getStackId()).isEqualTo(STACK_ID);
  converter.resetAllocations();
  assertThat(converter.getAllocationEvents().size()).isEqualTo(0);
}