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

@ -44,21 +44,19 @@ public class ConcurrentTest {
@Test
public void testTransform_addIntegers() throws Exception {
assertThat(Concurrent.transform(ImmutableList.of(1, 2, 3), new Function<Integer, Integer>() {
@Override
public Integer apply(Integer input) {
return input + 1;
}})).containsExactly(2, 3, 4).inOrder();
assertThat(Concurrent.transform(ImmutableList.of(1, 2, 3), input -> input + 1))
.containsExactly(2, 3, 4)
.inOrder();
}
@Test
public void testTransform_throwsException_isSinglyWrappedByUee() throws Exception {
try {
Concurrent.transform(ImmutableList.of(1, 2, 3), new Function<Integer, Integer>() {
@Override
public Integer apply(Integer input) {
throw new RuntimeException("hello");
}});
Concurrent.transform(
ImmutableList.of(1, 2, 3),
input -> {
throw new RuntimeException("hello");
});
fail("Didn't throw!");
} catch (UncheckedExecutionException e) {
// We can't use ExpectedException because root cause must be one level of indirection away.