Top "Guava" questions

Google's Core Java Library for Java and Android development.

Is there a corresponding immutable enumMap in guava?

I recently learnt about the benefits of EnumMap in Java and would like to replace the existing ImmutableMap<OccupancyType, …

java immutability guava enum-map
Flattening an Iterable<Iterable<T>> in Guava

Is there a flatten method in Guava - or an easy way to convert an Iterable<Iterable<T&…

java collections guava flatten
Google-guava checkNotNull and IntelliJ IDEA's "may produce java.lang.NullPointerException"

Is there any way to suppress this warning: MyClass object = null; /*Some code that 'might' set this object but I …

intellij-idea nullpointerexception guava inspection
Why do ImmutableList.of() and friends prohibit null elements?

Summary pretty much says it all. Here's the relevant snippet of code in ImmutableList.createFromIterable(): if (element == null) { throw new …

java collections guava
Simplest way to iterate through a Multiset in the order of element frequency?

Consider this example which prints out some device type stats. ("DeviceType" is an enum with a dozenish values.) Multiset<…

java guava multiset
@Nullable input in Google Guava Function interface triggers FindBugs warning

The com.google.common.base.Function interface (from Google Guava) defines apply as: @Nullable T apply(@Nullable F input); The …

java guava findbugs
How to solve 'Program type already present: com.google.common.util.concurrent.ListenableFuture'?

I am trying to use WorkManager 1.0.0-alpha09. and getting this error: Program type already present: com.google.common.util.concurrent.…

java android guava android-workmanager
Why does it.next() throw java.util.ConcurrentModificationException?

final Multimap<Term, BooleanClause> terms = getTerms(bq); for (Term t : terms.keySet()) { Collection<BooleanClause> C = new …

java collections guava multimap concurrentmodification
Cleaner way to check if a string is ISO country of ISO language in Java

Suppose to have a two-characters String, which should represent the ISO 639 country or language name. You know, Locale class has …

java validation guava apache-commons iso
Gradle "Could not find method compile() for arguments" for Guava

Iv'e looked at the other "Could not find method compile() for arguments" questions here but found nothing to help me. …

eclipse gradle guava buildship