public static <T> boolean containsValue(
     final Collection<? extends GenericValue<? extends T>> collection, T value) {
   for (GenericValue<? extends T> o : collection) {
     if (Comparing.equal(value, o.getValue())) return true;
   }
   return false;
 }
 public static boolean containsString(
     final Collection<? extends GenericValue<?>> collection, String value) {
   for (GenericValue<?> o : collection) {
     if (Comparing.equal(value, o.getStringValue())) return true;
   }
   return false;
 }
 @NotNull
 public static Collection<String> getStringCollection(
     final Collection<? extends GenericValue> collection, Collection<String> result) {
   for (GenericValue o : collection) {
     ContainerUtil.addIfNotNull(result, o.getStringValue());
   }
   return result;
 }
 @NotNull
 public static <T> Collection<T> getValueCollection(
     final Collection<? extends GenericValue<? extends T>> collection, Collection<T> result) {
   for (GenericValue<? extends T> o : collection) {
     ContainerUtil.addIfNotNull(result, o.getValue());
   }
   return result;
 }
 @NotNull
 public static Collection<String> getClassStringCollection(
     final Collection<? extends GenericValue> collection, Collection<String> result) {
   for (GenericValue o : collection) {
     final String value = o.getStringValue();
     if (value != null) {
       result.add(value.replace('$', '.'));
     }
   }
   return result;
 }
  private RewardType fromGenericValue(GenericValue genval) {
    if (genval == null) {
      return null;
    }
    long id = (Long) genval.get(ID_FIELD);
    String name = (String) genval.get(NAME_FIELD);
    String namepl = (String) genval.get(NAMEPL_FIELD);
    String desc = (String) genval.get(DESC_FIELD);
    String iconURL = (String) genval.get(ICON_FIELD);

    return new RewardType(id, name, namepl, desc, iconURL);
  }