code: public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals,
                                                                   List<Integer> keyReplicas,
                                                                   MutableBoolean didPrune) {
          List<Versioned<byte[]>> prunedVals = new ArrayList<Versioned<byte[]>>(vals.size());
          for(Versioned<byte[]> val: vals) {
              VectorClock clock = (VectorClock) val.getVersion();
              List<ClockEntry> clockEntries = new ArrayList<ClockEntry>();
              for(ClockEntry clockEntry: clock.getEntries()) {
                  if(keyReplicas.contains((int) clockEntry.getNodeId())) {
                      clockEntries.add(clockEntry);
                  } else {
                      didPrune.setValue(true);
                  }
              }
              prunedVals.add(new Versioned<byte[]>(val.getValue(),
                                                   new VectorClock(clockEntries, clock.getTimestamp())));
          }
          return prunedVals;
      }
docs: Remove all non replica clock entries from the list of versioned values
  provided
  
  @param vals list of versioned values to prune replicas from
  @param keyReplicas list of current replicas for the given key
  @param didPrune flag to mark if we did actually prune something
  @return pruned list