Atomix extends AtomixCluster { @Override public synchronized CompletableFuture<Void> stop() { if (shutdownHook != null) { try { Runtime.getRuntime().removeShutdownHook(shutdownHook); shutdownHook = null; } catch (final IllegalStateException e) { } } return super.stop(); } Atomix(final String... configFiles);  Atomix(final ClassLoader classLoader, final String... configFiles);  Atomix(final File... configFiles);  Atomix(final ClassLoader classLoader, final File... configFiles);  Atomix(final ClassLoader classLoader, final List<File> configFiles); protected  Atomix(final AtomixConfig config, final AtomixRegistry registry); @SuppressWarnings("unchecked") protected  Atomix(
      final AtomixConfig config,
      final AtomixRegistry registry,
      final ManagedMessagingService messagingService,
      final ManagedUnicastService unicastService,
      final ManagedBroadcastService broadcastService); static AtomixConfig config(); static AtomixConfig config(final ClassLoader classLoader); static AtomixConfig config(final AtomixRegistry registry); static AtomixConfig config(final String... files); static AtomixConfig config(final ClassLoader classLoader, final String... files); static AtomixConfig config(final AtomixRegistry registry, final String... files); static AtomixConfig config(final File... configFiles); static AtomixConfig config(final List<File> files); static AtomixConfig config(final ClassLoader classLoader, final List<File> files); static AtomixConfig config(final AtomixRegistry registry, final List<File> files); static AtomixBuilder builder(); static AtomixBuilder builder(final ClassLoader classLoader); static AtomixBuilder builder(final AtomixRegistry registry); static AtomixBuilder builder(final String config); static AtomixBuilder builder(final String configFile, final ClassLoader classLoader); static AtomixBuilder builder(final String configFile, final AtomixRegistry registry); static AtomixBuilder builder(final AtomixConfig config); static AtomixBuilder builder(final AtomixConfig config, final ClassLoader classLoader); static AtomixBuilder builder(final AtomixConfig config, final AtomixRegistry registry); PartitionService getPartitionService(); @Override synchronized CompletableFuture<Void> start(); @Override synchronized CompletableFuture<Void> stop(); @Override String toString();  }
@Test public void testStopStartConsensus() throws Exception { final var atomix = atomixRule .startAtomix( 1, Arrays.asList(1), (builder) -> { final var groupConfig = new RaftPartitionGroupConfig() .setName("raft") .setPartitionSize(3) .setPartitions(7) .setMembers(Set.of("1")) .setStorageConfig( new RaftStorageConfig() .setDirectory( new File(atomixRule.getDataDir(), "start-stop-consensus") .getPath())); final var raftPartitionGroup = new RaftPartitionGroup(groupConfig); return builder.withPartitionGroups(raftPartitionGroup).build(); }) .get(TIMEOUT_IN_S, TimeUnit.SECONDS); final var stopFuture = atomix.stop(); assertThat(stopFuture).succeedsWithin(TIMEOUT_IN_S, TimeUnit.SECONDS); assertThat(stopFuture).isDone(); }