@Test
public void apiNegotiationTargetVersionInRange() {

    TestFactory clientFactory = createTestFactory();
    DockerAPIVersion targetVersion = DockerAPIVersion.parse("8.5");
    List<Consumer<TestDockerClient>> fixtures = Arrays.asList(
            clt -> {
                clt.setMinAPIVersion(DockerAPIVersion.parse("8.0"));
                clt.setSupportedAPIVersion(DockerAPIVersion.parse("9.99"));
            },
            clt -> {
                clt.setMinAPIVersion(DockerAPIVersion.parse("8.5"));
                clt.setSupportedAPIVersion(DockerAPIVersion.parse("9.99"));
            },
            clt -> {
                clt.setMinAPIVersion(DockerAPIVersion.parse("8.0"));
                clt.setSupportedAPIVersion(DockerAPIVersion.parse("8.5"));
            }
    );
    DockerClientConfig config = new DockerClientConfig(TestDockerClient.TEST_CLIENT_URI,
            targetVersion);
    fixtures.forEach(fixture -> {
        clientFactory.fixture = fixture;
        TestDockerClient client = (TestDockerClient) clientFactory.createClientWithAPINegotiation(config);
        assertThat(client.getApiVersion()).isEqualTo(targetVersion);
    });
}