@Test
public void testAllocateNumaCpusResource() throws ResourceHandlerException {

  // allocates node 0 for memory and cpu
  testAllocateNumaResource("container_1481156246874_0001_01_000001",
      Resource.newInstance(2048, 2), "0", "0");
  // allocates node 1 for memory and cpu since allocator uses round
  // robin assignment
  testAllocateNumaResource("container_1481156246874_0001_01_000002",
      Resource.newInstance(2048, 2), "1", "1");
  // allocates node 0,1 for cpus since there is are no sufficient cpus
  // available in any one node
  testAllocateNumaResource("container_1481156246874_0001_01_000003",
      Resource.newInstance(2048, 3), "0", "0,1");
  // returns null since there are no sufficient resources available for the
  // request
  when(mockContainer.getContainerId()).thenReturn(
      ContainerId.fromString("container_1481156246874_0001_01_000004"));
  when(mockContainer.getResource()).thenReturn(Resource.newInstance(2048, 2));
  assertNull(numaResourceHandler.preStart(mockContainer));
  // allocates node 1 for memory and cpu
  testAllocateNumaResource("container_1481156246874_0001_01_000005",
      Resource.newInstance(2048, 1), "1", "1");
}