With this sequence of chain calls, the compiler cannot output a type argument for the call naturalOrder(), since its result is not immediately assigned to what it can use for output.
You can write
ImmutableSortedSet<String> ok = ImmutableSortedSet.<String>naturalOrder().build();
or
ImmutableSortedSet.Builder<String> builder = ImmutableSortedSet.naturalOrder();
ImmutableSortedSet<String> ok = builder.build();
source
share