@Test
public void testRefresh() {

    OshiPlatformCache oshi = newOshiPlatformCache();
    Object os1 = oshi.getOperatingSystem();
    Object mem1 = oshi.getMemory();
    Object fs1 = oshi.getFileStores();
    Object proc1 = oshi.getProcessor();
    Object ps1 = oshi.getPowerSources();
    // see that they are cached - same objects as before
    Object os2 = oshi.getOperatingSystem();
    Object mem2 = oshi.getMemory();
    Object fs2 = oshi.getFileStores();
    Object proc2 = oshi.getProcessor();
    Object ps2 = oshi.getPowerSources();
    Assert.assertSame(os1, os2);
    Assert.assertSame(mem1, mem2);
    Assert.assertSame(fs1, fs2);
    Assert.assertSame(proc1, proc2);
    Assert.assertSame(ps1, ps2);
    // refresh and see that they are now different
    oshi.refresh();
    os2 = oshi.getOperatingSystem();
    mem2 = oshi.getMemory();
    fs2 = oshi.getFileStores();
    proc2 = oshi.getProcessor();
    ps2 = oshi.getPowerSources();
    Assert.assertNotSame(os1, os2);
    Assert.assertNotSame(mem1, mem2);
    Assert.assertNotSame(fs1, fs2);
    Assert.assertNotSame(proc1, proc2);
    Assert.assertNotSame(ps1, ps2);
}