Hardware { public static int getNumberCPUCores() { return Runtime.getRuntime().availableProcessors(); } private  Hardware(); static int getNumberCPUCores(); static long getSizeOfPhysicalMemory();  }
@Test public void testCpuCores() { try { assertTrue(Hardware.getNumberCPUCores() >= 0); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }