code: private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) {
          if (volumeIds != null && volumeIds.size() > 0) {
              for (String volId : volumeIds) {
                  if (volId.equals(volumeId)) {
                      return true;
                  }
              }
          }
  
          return false;
      }
docs: Check whether volumeId exists in list.
  @param volumeIds List of volume Ids.
  @param volumeId to check in the list.
  @return true if volumeId is valid.