@Test
public void grantedIfFreeMemoryCheckReturnsZero() throws Exception {

  final OsMemoryUtil memUtil = mock(OsMemoryUtil.class);
  final long availableFreeMem = 0;
  when(memUtil.getOsTotalFreeMemorySize()).thenReturn(availableFreeMem);
  final SystemMemoryInfo memInfo = new SystemMemoryInfo(memUtil);
  final long xmx = 0;
  final boolean isGranted = memInfo.canSystemGrantMemory(xmx);
  assertTrue("Memory check failed. Should fail open", isGranted);
}