private KeyValueResult satisfies(long key, int itemCount, byte[] items) {
    int count = 0;

    for (int itemIndex = 0; itemIndex < items.length; itemIndex++) {
      byte item = items[itemIndex];
      boolean found = false;
      for (int i = 0; i < 6; i++) {
        byte itemFound = ByteUtils.decodeByte(key, 2 + i);
        if (itemFound == Constants.ANY_ITEM_INDEX) {
          continue;
        }

        if (itemIndex == 0 && count++ > itemCount) {
          return null;
        }

        if (itemFound == item) {
          found = true;
        }
      }

      if (!found) {
        return null;
      }
    }

    if (count != itemCount) {
      return null;
    }

    KeyValueResult result = new KeyValueResult();
    ByteUtils.decode(key, result.key);
    return result;
  }
  private KeyValueResult satisfies(long key, int itemCount) {
    int count = 0;

    for (int i = 0; i < 6; i++) {
      byte itemFound = ByteUtils.decodeByte(key, 2 + i);
      if (itemFound == Constants.ANY_ITEM_INDEX) {
        continue;
      }

      if (count++ > itemCount) {
        return null;
      }
    }

    if (count != itemCount) {
      return null;
    }

    KeyValueResult result = new KeyValueResult();
    ByteUtils.decode(key, result.key);
    return result;
  }
 protected static float winrate(int value) {
   return (float) ByteUtils.decodeFirst(value) / ByteUtils.decodeSecond(value);
 }
  private int getValue(byte rank, byte champId, byte[] items) {
    long key =
        ByteUtils.encode(rank, champId, items[0], items[1], items[2], items[3], items[4], items[5]);

    return stats.get(key, Integer.MAX_VALUE);
  }
 private boolean rankMismatch(byte rank, long key) {
   return rank != ByteUtils.decodeByte(key, 0);
 }
 private boolean champMismatch(byte champId, long key) {
   return champId != ByteUtils.decodeByte(key, 1);
 }
 private void populate(int value, KeyValueResult result) {
   result.setGamesPlayed(ByteUtils.decodeSecond(value));
   result.setAdaptive(winrate(value));
 }