BaseDockerClientFacade implements DockerClientFacade { @Nonnull @Override public final Optional<DockerDaemonOS> getDaemonOS() { String os = client.getVersion().getAsString("Os"); return DockerDaemonOS.fromString(os); } BaseDockerClientFacade(DockerClient client); @Nonnull @Override final Optional<DockerDaemonOS> getDaemonOS(); @Override final void close();  }
@Test public void getDaemonOs() { DockerClientFacade facade = createFacade(dockerClient); dockerClient.setDaemonOs(DockerDaemonOS.WINDOWS.getAttribute()); Optional<DockerDaemonOS> daemonOS = facade.getDaemonOS(); assertThat(daemonOS).isEqualTo(Optional.of(DockerDaemonOS.WINDOWS)); dockerClient.setDaemonOs("not_an_real_os"); daemonOS = facade.getDaemonOS(); assertThat(daemonOS).isEmpty(); }