code: private static synchronized void closeRegisteredConnections() {
          for (Connection connection : activeConnections) {
              LOGGER.log(Level.INFO, "Forcing connection to {0}:{1} closed.",
                      new Object[]{connection.getHostname(), connection.getPort()});
              // force closed just in case
              connection.close();
          }
          activeConnections.clear();
      }
docs: Closes all the registered connections.