code: private boolean keyAlreadyExists(String newKey) {
  
          Collection<?> itemIds = m_table.getItemIds();
          for (Object itemId : itemIds) {
              if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
                  return true;
              }
          }
          return false;
      }
docs: Checks if a key already exists.
  @param newKey the key to check for.
  @return <code>true</code> if the key already exists, <code>false</code> otherwise.