public static List<BitGroup> partition(long[] values, int size) {
		List<BitGroup> list = new LinkedList<>();
		long usedBits = 0;
		for (long value : values) {
			usedBits |= value;
			BitGroup bitGroup = new BitGroup(value);
			merge(list, bitGroup);
		}

		// now create a BitGroup for all bits not accounted for
		int bits = size * 8;
		long allEnumBits = ~(-1L << bits);
		long unusedBits = ~usedBits;
		list.add(new BitGroup(unusedBits & allEnumBits));

		return list;
	}
Partition the given values into a list of non-intersecting BitGroups.
@param values the values to be partitioned.
@param size size of enum value in bytes
@return a list of BitGroups with non-intersecting bits.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/EnumValuePartitioner.java