public boolean isVersionActive(final ClientPlatform platform, final Semver version) {
    final Map<Semver, ClientRelease> releasesByVersion = clientReleasesByPlatform.get(platform);

    return releasesByVersion != null &&
        releasesByVersion.containsKey(version) &&
        releasesByVersion.get(version).expiration().isAfter(clock.instant());
  }
@Test
  void isVersionActive() {
    final Semver iosVersion = new Semver("1.2.3");
    final Semver desktopVersion = new Semver("4.5.6");

    when(clientReleases.getClientReleases()).thenReturn(Map.of(
        ClientPlatform.DESKTOP, Map.of(desktopVersion, new ClientRelease(ClientPlatform.DESKTOP, desktopVersion, clock.instant(), clock.instant().plus(Duration.ofDays(90)))),
        ClientPlatform.IOS, Map.of(iosVersion, new ClientRelease(ClientPlatform.IOS, iosVersion, clock.instant().minus(Duration.ofDays(91)), clock.instant().minus(Duration.ofDays(1))))
    ));

    clientReleaseManager.refreshClientVersions();

    assertTrue(clientReleaseManager.isVersionActive(ClientPlatform.DESKTOP, desktopVersion));
    assertFalse(clientReleaseManager.isVersionActive(ClientPlatform.DESKTOP, iosVersion));
    assertFalse(clientReleaseManager.isVersionActive(ClientPlatform.IOS, iosVersion));
    assertFalse(clientReleaseManager.isVersionActive(ClientPlatform.ANDROID, new Semver("7.8.9")));
  }