public List<Integer> getMaskedIndexes() {
        List<Integer> ret = new LinkedList<>();

        // the index of the item slot in the inventory
        int invIndex = 0;

        // iterate all of the loaded masks
        for (boolean[] mask : this.maskRows) {
            // iterate the values in the mask (0 --> 8)
            for (boolean b : mask) {

                // increment the index in the gui. we're handling a new item.
                int index = invIndex++;

                // if this index is masked.
                if (b) {
                    ret.add(index);
                }
            }
        }

        return ret;
    }
Helps to populate a menu with border items
helper/src/main/java/me/lucko/helper/menu/scheme/MenuScheme.java