code: private static Optional<Invocable> newInvocable(final Object target, final Collection<Supplier<Reader>> scripts) {
  
          Optional<Invocable> invocable;
          if (!scripts.isEmpty()) {
              final ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
              engine.put("target", target);
              scripts.stream().forEach(script -> loadScript(engine, script));
              invocable = Optional.of((Invocable) engine);
          } else {
              invocable = Optional.empty();
          }
  
          return invocable;
      }
docs: Creates a new invocable proxy. The proxy may be used to create interface implementations that are implemented in
  javascript.
  
  @param target  the target object that is passed into the scripting context so that the methods in the script may access
  the target object.
  @param scripts scripts to be loaded into the engine
  @return the invocable instance