static List<List<Integer>> getAllConstraintCombinations() {
    List<List<Integer>> combos = new ArrayList<>();

    combos.add(Collections.<Integer>emptyList());
    for (Integer cur : Constraint.ALL_CONSTRAINTS) {
      for (int l = combos.size() - 1; l >= 0; l--) {
        List<Integer> oldCombo = combos.get(l);
        List<Integer> newCombo = Arrays.asList(new Integer[oldCombo.size() + 1]);

        Collections.copy(newCombo, oldCombo);
        newCombo.set(oldCombo.size(), cur);
        combos.add(newCombo);
      }
      combos.add(Collections.singletonList(cur));
    }

    return combos;
  }
Provides common utilities helpful for testing.
jobdispatcher/src/testLib/com/firebase/jobdispatcher/TestUtil.java