anchor.diff:      replace_subpartition_chunk(VnodeIdx, Node, {Mask, Bits}, NVal,
                                  ReqId, DownNodes, Service, CHBin,
                                  ?AVAIL_NODE_FUN).
  +
  +%% ====================================================================
  +%% Internal functions that are useful for other riak_core applications
  +%% that need to generate custom coverage plans
  +%% ====================================================================
  +
  +
  +-spec identify_unavailable_vnodes(chashbin:chashbin(), pos_integer(), atom()) ->
  +                                         list(vnode_id()).
  +identify_unavailable_vnodes(CHBin, RingSize, Service) ->
  +    identify_unavailable_vnodes(CHBin, RingSize, Service, ?AVAIL_NODE_FUN).
  +
  +-spec identify_unavailable_vnodes(chashbin:chashbin(), pos_integer(), atom(),
  +                                  fun((atom(), binary()) -> list(node()))) ->
  +                                         list(vnode_id()).
  +identify_unavailable_vnodes(CHBin, RingSize, Service, AvailNodeFun) ->
  +    %% Get a list of the VNodes owned by any unavailable nodes
  +    [{vnode_id, index_to_id(Index, RingSize), RingSize} ||
  +        {Index, _Node}
  +            <- riak_core_apl:offline_owners(
  +                 AvailNodeFun(Service, CHBin), CHBin)].
  +
  +%% Adding an offset while keeping the result inside [0, Top). Adding
  +%% Top to the left of `rem' allows offset to be negative without
  +%% violating the lower bound of zero
  +add_offset(Position, Offset, Top) ->
  +    (Position + (Top + Offset)) rem Top.
   
   %% ====================================================================
   %% Internal functions
  
positive.code: %% API
  -export([create_plan/6, create_subpartition_plan/6]).
  -export([replace_subpartition_chunk/7, replace_traditional_chunk/7]).
  
  -type ring_size() :: pos_integer().
  
  
negative.code: 
  
  %% @private
  increment_vnode({vnode_id, Position, RingSize}, Offset) ->
      {vnode_id, add_offset(Position, Offset, RingSize), RingSize}.
  
  