DefaultAllocateCountTracker tracker = new DefaultAllocateCountTracker(new Configuration());
ContainerAllocateData containerAllocateData = new ContainerAllocateData();
containerAllocateData.addHosts("host1", 1);
containerAllocateData.addRacks("/default-rack", 1);
tracker.addContainers(containerAllocateData);
AllocateCountInfo allocateCounts = tracker.getAllocateCounts();
assertThat(allocateCounts, notNullValue());
assertThat(allocateCounts.anysInfo.size(), is(1));
assertThat(allocateCounts.anysInfo.get("*"), is(2));
assertThat(allocateCounts.hostsInfo.size(), is(1));
assertThat(allocateCounts.hostsInfo.get("host1"), is(1));