code: public static String serializeKeys(Set<String> foreignKeys)
      {
          if (null == foreignKeys || foreignKeys.isEmpty())
          {
              return null;
          }
  
          StringBuilder sb = new StringBuilder();
          for (String key : foreignKeys)
          {
              if (sb.length() > 0)
              {
                  sb.append(Constants.FOREIGN_KEY_SEPARATOR);
              }
              sb.append(key);
          }
          return sb.toString();
      }
docs: Creates a string representation of a set of foreign keys by combining
  them together separated by "~" character.
  
  Note: Assumption is that @Id will never contain "~" character. Checks for
  this are not added yet.
  
  @param foreignKeys
  the foreign keys
  @return the string