@Test
public void getProcessors() {

    OshiPlatformCache oshi = newOshiPlatformCache();
    CentralProcessor processor = oshi.getProcessor();
    Assert.assertNotNull(processor);
    Util.sleep(2000L); // sleep to let processors be able to calculate load
    for (int i = 0; i < processor.getLogicalProcessorCount(); i++) {
        String name = processor.getName();
        String family;
        try {
            family = processor.getFamily();
        } catch (UnsupportedOperationException e) {
            family = "";
            print(processor.getClass().getName() + ".getFamily() unsupported on " + System.getProperty("os.name")
                    + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
        }
        String identifier = processor.getIdentifier();
        String model;
        try {
            model = processor.getModel();
        } catch (UnsupportedOperationException e) {
            model = "";
            print(processor.getClass().getName() + ".getModel() unsupported on " + System.getProperty("os.name")
                    + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
        }
        String stepping;
        try {
            stepping = processor.getStepping();
        } catch (UnsupportedOperationException e) {
            stepping = "";
            print(processor.getClass().getName() + ".getStepping() unsupported on " + System.getProperty("os.name")
                    + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
        }
        String vendor = processor.getVendor();
        double systemCpuLoad = processor.getSystemCpuLoad();
        double systemLoadAverage = processor.getSystemLoadAverage();
        int processorNumber = i;
        long systemUpTime = processor.getSystemUptime();
        long vendorFrequency = processor.getVendorFreq();
        boolean isCpu64bit;
        try {
            isCpu64bit = processor.isCpu64bit();
        } catch (UnsupportedOperationException e) {
            print(processor.getClass().getName() + ".isCpu64bit() unsupported on " + System.getProperty("os.name")
                    + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
            isCpu64bit = false;
        }
        long[] processorCpuLoadTicks = processor.getProcessorCpuLoadTicks()[i];
        long[] systemCpuLoadTicks = processor.getSystemCpuLoadTicks();
        processor.getProcessorCpuLoadBetweenTicks();
        processor.getSystemCpuLoadBetweenTicks();
        Util.sleep(1100L); // provide some time to let the getXCpuLoadBetweenTicks have good data to use
        double processorCpuLoadBetweenTicks = processor.getProcessorCpuLoadBetweenTicks()[i];
        double systemCpuLoadBetweenTicks = processor.getSystemCpuLoadBetweenTicks();
        Assert.assertNotNull(name);
        Assert.assertNotNull(family);
        Assert.assertNotNull(identifier);
        Assert.assertNotNull(model);
        Assert.assertNotNull(stepping);
        Assert.assertNotNull(vendor);
        print("===PROCESSOR #%d ===", i);
        print("  Name=[%s]", name);
        print("  Family=[%s]", family);
        print("  Identifier=[%s]", identifier);
        print("  Model=[%s]", model);
        print("  Stepping=[%s]", stepping);
        print("  Vendor=[%s]", vendor);
        print("  SystemCpuLoad=[%.2f]", systemCpuLoad);
        print("  SystemLoadAverage=[%.2f]", systemLoadAverage);
        print("  ProcessorNumber=[%d]", processorNumber);
        print("  SystemUpTime=[%s] (%d)", FormatUtil.formatElapsedSecs(systemUpTime), systemUpTime);
        print("  VendorFreq=[%s] (%d)", FormatUtil.formatHertz(vendorFrequency), vendorFrequency);
        print("  IsCpu64BitVendor=[%s]", isCpu64bit);
        print("  ProcessorCpuLoadTicks=[user=%d/nice=%d/system=%d/idle=%d]",
                processorCpuLoadTicks[0], processorCpuLoadTicks[1],
                processorCpuLoadTicks[2], processorCpuLoadTicks[3]);
        print("  SystemCpuLoadTicks=[user=%d/nice=%d/system=%d/idle=%d]",
                systemCpuLoadTicks[0], systemCpuLoadTicks[1],
                systemCpuLoadTicks[2], systemCpuLoadTicks[3]);
        print("  ProcessorCpuLoadBetweenTicks=[%.2f]", processorCpuLoadBetweenTicks);
        print("  SystemCpuLoadBetweenTicks=[%.2f]", systemCpuLoadBetweenTicks);
        print("  toString=[%s]", processor.toString());
    }
}