public static long getVersionAsLong(Id<?> id) throws IllegalArgumentException {

    Long version = getVersionAs(id, Long.class);
    if (version == null) {
      return 0;
    }
    return version.longValue();
  }
public static long getVersionAsLong ( Id < ? > id ) throws IllegalArgumentException { Long version = getVersionAs ( id , Long . class ) ; if ( version == null ) { return 0 ; } return version . longValue ( ) ; }
@param id the actual {@link Id} instance.
@return the {@link #getVersion() version} of the given {@link Id}. May be {@code null} if the given {@link Id}
itself or its {@link #getVersion() version} is {@code null}.
@throws IllegalArgumentException if the given {@code type} does not match.