code: public static void attachSignalHandler(final Runnable runnable) {
          Signal.handle(SIG_INT, new SignalHandler() {
              @Override
              public void handle(Signal signal) {
                  runnable.run();
              }
          });
      }
docs: Handle {@literal INT} signals by calling the specified {@link Runnable}.
  
  @param runnable the runnable to call on SIGINT.