public void createDevices(@NotNull List<Device> devices){
  if (!initIfNecessary()) {
    return;
  }
  for (  Device device : devices) {
    String deviceIdBase=device.getId();
    String deviceNameBase=device.getDisplayName();
    int i=2;
    while (isUserDevice(device)) {
      String id=String.format(Locale.getDefault(),"%1$s_%2$d",deviceIdBase,i);
      String name=String.format(Locale.getDefault(),"%1$s_%2$d",deviceNameBase,i);
      device=cloneDeviceWithNewIdAndName(device,id,name);
    }
    ourDeviceManager.addUserDevice(device);
  }
  ourDeviceManager.saveUserDevices();
}

public void createDevices ( @ NotNull List < Device > devices ) { if ( ! initIfNecessary ( ) ) { return ; } for ( Device device : devices ) { String deviceIdBase = device . getId ( ) ; String deviceNameBase = device . getDisplayName ( ) ; int i = 2 ; while ( isUserDevice ( device ) ) { String id = String . format ( Locale . getDefault ( ) , "%1$s_%2$d" , deviceIdBase , i ) ; String name = String . format ( Locale . getDefault ( ) , "%1$s_%2$d" , deviceNameBase , i ) ; device = cloneDeviceWithNewIdAndName ( device , id , name ) ; } ourDeviceManager . addUserDevice ( device ) ; } ourDeviceManager . saveUserDevices ( ) ; }
create the given devices
