code: public static List<VirtualMachineDescriptor> list()
     {
        List<VirtualMachineDescriptor> l = new ArrayList<VirtualMachineDescriptor>();
        List<AttachProvider> providers = AttachProvider.providers();
  
        for (AttachProvider provider : providers) {
           l.addAll(provider.listVirtualMachines());
        }
  
        return l;
     }
docs: <p>
  Return a list of Java virtual machines.
  </p>
  <p>
  This method returns a list of Java {@link com.sun.tools.attach.VirtualMachineDescriptor}
  elements.  The list is an aggregation of the virtual machine descriptor lists obtained by
  invoking the {@link com.sun.tools.attach.spi.AttachProvider#listVirtualMachines
  listVirtualMachines} method of all installed {@link com.sun.tools.attach.spi.AttachProvider
  attach providers}.  If there are no Java virtual machines known to any provider then an empty
  list is returned.
  </p>
  @return The list of virtual machine descriptors.