OS { public static boolean isLinux() { return osIsLinux; }  static boolean isMacOSX(); static boolean isWindows(); static boolean isWindowsXP(); static boolean isWindows2003(); static boolean isWindowsVista(); static boolean isLinux(); static boolean isUsingWindowsVisualStyles(); static String getWindowsVisualStyle();  }
@Test public void testOSNPE() { String oldProperty = System.getProperty("os.name"); try { if (oldProperty != null) { System.clearProperty("os.name"); assertNull(System.getProperty("os.name")); } OS.isLinux(); } finally { if (oldProperty != null) { System.setProperty("os.name", oldProperty); assertEquals(oldProperty, System.getProperty("os.name")); } } }