code: public static void safeRelease(Object msg) {
  		if (msg instanceof ReferenceCounted) {
  			ReferenceCounted referenceCounted = (ReferenceCounted) msg;
  			if (referenceCounted.refCnt() > 0) {
  				referenceCounted.release();
  			}
  		}
  	}
docs: Try to call {@link ReferenceCounted#release()} if the specified message implements {@link ReferenceCounted}.
  If the specified message doesn't implement {@link ReferenceCounted} or it is already released,
  this method does nothing.