docs: public static void premain(String args, Instrumentation instrumentation) {
          if (!PreMainUtil.isBeta() && !PreMainUtil.isEnableAgentPropertySet()) {
              // if it's not beta, do nothing.
              // this implementation should be changed when this will be in the production code.
              return;
          }
          ObjectInputStreamTransformer transform = null;
          if (ObjectInputStreamClassInjector.injectionNeeded()) {
              // Install the transformer to modify ObjectInputStream.
              if (PreMainUtil.isDebugEnabled()) {
                  System.out.println("Using class file transformer to modify ObjectInputStream.");
              }
              transform = new ObjectInputStreamTransformer();
              instrumentation.addTransformer(transform);
          }
          try {
              initialiseObjectInputStream();    
          } finally {
              // Uninstall the class transformer.
              if (transform != null) {
                  if (PreMainUtil.isDebugEnabled()) {
                      System.out.println("Removing class file transformer.");
                  }
                  instrumentation.removeTransformer(transform);
              }
          }
          
          AccessController.doPrivileged(new PrivilegedAction<String>() {
              public String run() {
                  return System.setProperty(PreMainUtil.KEY_SERIALFILTER_AGENT_ACTIVE, "true");
              }
          });
      }