我正在尝试使用 Maven 在 Intellij-idea 中构建一个项目,但出现错误提示
"Cannot resolve method 'combinations' in 'Sets'
public Set<Set<String>> GetCombinationsSet(){
System.out.println("Mapper: Calculating combinations");
ArrayList<String> resources = new ArrayList<>(timeHarMap.keySet());
Set<Set<String>> combinations = Sets.combinations(ImmutableSet.copyOf(resources), 2);
//System.out.println(combinations.toArray().length);
return combinations;
}
进口即时通讯使用:
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
我在 pom.xml 中有番石榴依赖项,尝试放置此依赖项但它不起作用:
<dependency>
<groupId>com.google.common</groupId>
<artifactId>google-collect</artifactId>
<version>0.5</version>
</dependency>