mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Run automatic Java 8 conversion over codebase
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171174380
This commit is contained in:
parent
44df5da771
commit
5edb7935ed
190 changed files with 2312 additions and 3096 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue