code: public void open() throws Exception {
  
          if (blockCount != -1) {
              throw new IllegalStateException("Raid1Device is already opened!");
          }
  
          for (Device device : devices) {
              device.open();
          }
  
          // check if all devices have the same block size
          blockSize = 0;
          for (Device device : devices) {
              if (blockSize == 0) {
                  blockSize = (int)device.getBlockSize();
              } else if (blockSize != (int)device.getBlockSize()) {
                  throw new IllegalArgumentException("All devices must have the same block size!");
              }
          }
  
          // find the smallest device
          blockCount = Long.MAX_VALUE;
          for (Device device : devices) {
              blockCount = Math.min(blockCount, device.getBlockCount());
          }
  
      }
docs: {@inheritDoc}