code: private static Method getAttachMethod(Class<?> vmClass) throws SecurityException, NoSuchMethodException {
          return vmClass.getMethod("attach", new Class<?>[] { String.class });
      }
docs: Finds attach method in VirtualMachine.
  
  @param vmClass
  VirtualMachine class
  @return 'attach' Method
  @throws SecurityException
  If access is not legal
  @throws NoSuchMethodException
  If no such method is found