@Test
public void grantedIfFreeMemoryAvailable() throws Exception {

  final OsMemoryUtil memUtil = mock(OsMemoryUtil.class);
  final long availableFreeMem = 10L * 1024L * 1024L; //10 GB
  when(memUtil.getOsTotalFreeMemorySize()).thenReturn(availableFreeMem);
  final SystemMemoryInfo memInfo = new SystemMemoryInfo(memUtil);
  final boolean isGranted = memInfo.canSystemGrantMemory(1);
  assertTrue(isGranted);
}