public List<TraverseMode> getModes() {
        ArrayList<TraverseMode> modeList = new ArrayList<TraverseMode>();
        for (TraverseMode mode : TraverseMode.values()) {
            int mask = getMaskForMode(mode);
            if (mask != 0 && (modes & mask) == mask) {
                modeList.add(mode);
            }
        }
        return modeList;
    }