### Question:
SystemEnvironment { public static OsType getOsType() { final String osName = System.getProperty("os.name", "none").toLowerCase(Locale.US); if (osName.contains("mac") || osName.contains("darwin")) { return OsType.macOs; } else if (osName.contains("win")) { return OsType.Windows; } else { return OsType.Linux; } } private  SystemEnvironment(); static OsType getOsType();  }### Answer:
@Test public void testDarwin() { System.setProperty("os.name", "darwin"); SystemEnvironment.OsType osType = SystemEnvironment.getOsType(); assertThat(osType, IsEqual.equalTo(SystemEnvironment.OsType.macOs)); }
@Test public void testMac() { System.setProperty("os.name", "mac"); SystemEnvironment.OsType osType = SystemEnvironment.getOsType(); assertThat(osType, IsEqual.equalTo(SystemEnvironment.OsType.macOs)); }
@Test public void testWindows() { System.setProperty("os.name", "WINDOWS"); SystemEnvironment.OsType osType = SystemEnvironment.getOsType(); assertThat(osType, IsEqual.equalTo(SystemEnvironment.OsType.Windows)); }
@Test public void testLinux() { System.setProperty("os.name", "NOTSOMEEXPECTEDVALUE"); SystemEnvironment.OsType osType = SystemEnvironment.getOsType(); assertThat(osType, IsEqual.equalTo(SystemEnvironment.OsType.Linux)); }