code: public <T> T cast(Object obj, Class<T> clz) {
          if (!clz.isAssignableFrom(obj.getClass())) {
              return null;
          }
          return clz.cast(obj);
      }
docs: This method casts the supplied object to the nominated
  class. If the object cannot be cast to the provided type,
  then a null will be returned.
  
  @param obj The object
  @param clz The class to cast to
  @return The cast object, or null if the object cannot be cast