Run automatic Java 8 conversion over codebase

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171174380
This commit is contained in:
mcilwain 2017-10-05 10:48:38 -07:00 committed by Ben McIlwain
parent 44df5da771
commit 5edb7935ed
190 changed files with 2312 additions and 3096 deletions

View file

@ -14,8 +14,8 @@
package google.registry.util;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
@ -59,13 +59,11 @@ public final class TokenUtils {
final TokenType type,
StringGenerator generator,
int count) {
return FluentIterable.from(generator.createStrings(type.getLength(), count))
.transform(new Function<String, String>() {
@Override
public String apply(String token) {
return String.format("%s_%s", type.getPrefix(), token);
}})
.toSet();
return generator
.createStrings(type.getLength(), count)
.stream()
.map(token -> String.format("%s_%s", type.getPrefix(), token))
.collect(toImmutableSet());
}
private TokenUtils() {}