1
for (Set<Integer> s : SetUtils.powerSet(mySet))

I tried running the above code, but SetUtils variable was not found. I am using Java 1.8.

What should I import to run the above statement?

Todd
  • 30,472
  • 11
  • 81
  • 89
bubsoncode
  • 11
  • 5
  • SetUtils is not part of the Java SE 1.8 API. You'll need to add the Apache Commons Collections library as a JAR, and import `org.apache.commons.collections4`. – nanofarad Apr 09 '16 at 19:19

1 Answers1

4

You should import org.apache.commons.collections4.SetUtils.

If your IDE didn't handled adding the library see this How do I learn to use Java commons-collections? to learn how to use that in your project.

You can find required jar files from apache site.

Community
  • 1
  • 1
Ali Seyedi
  • 1,758
  • 1
  • 19
  • 24