void (MavenServerConnector connector) { RemoteProcessSupport support = ReflectionUtil.getField(MavenServerConnectorImpl.class, connector, RemoteProcessSupport.class, "mySupport"); AtomicReference<RemoteProcessSupport.Heartbeat> heartbeat = ReflectionUtil.getField(RemoteProcessSupport.class, support, AtomicReference.class, "myHeartbeatRef"); heartbeat.get().kill(1); new WaitFor(10_000) { @Override protected boolean condition() { return !connector.checkConnected(); } }; assertFalse(connector.checkConnected()); }