Skip to content

Commit

Permalink
Replace statement lambdas with expression lambdas.
Browse files Browse the repository at this point in the history
  • Loading branch information
motlin committed May 3, 2016
1 parent 617cd8e commit 8531783
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ private MutableList<Function0<Iterable<Integer>>> getIntegerListGenerators(int c
{
Interval interval = Interval.fromTo(-(count / 2), count / 2 - 1);
MutableList<Function0<Iterable<Integer>>> generators = FastList.newList();
generators.add(() -> {
return interval.toList().shuffleThis();
});
generators.add(() -> interval.toList().shuffleThis());
generators.add(() -> {
MutableList<Integer> integers = interval.toList().shuffleThis();
return integers.toImmutable();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 Goldman Sachs.
* Copyright (c) 2016 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -56,9 +56,7 @@ public void ofElements()
public void withElements()
{
Assert.assertEquals(new ImmutableSortedBagImpl<>(SortedBags.mutable.with(1, 1, 2)), SortedBags.immutable.with(1, 1, 2));
Verify.assertThrows(IllegalArgumentException.class, () -> {
new ImmutableSortedBagImpl<>(SortedBags.mutable.with(Comparators.reverseNaturalOrder(), FastList.newList().toArray()));
});
Verify.assertThrows(IllegalArgumentException.class, () -> new ImmutableSortedBagImpl<>(SortedBags.mutable.with(Comparators.reverseNaturalOrder(), FastList.newList().toArray())));
Assert.assertEquals(new ImmutableSortedBagImpl<>(SortedBags.mutable.with(Comparators.reverseNaturalOrder(), 1, 1, 2)), SortedBags.immutable.with(Comparators.reverseNaturalOrder(), 1, 1, 2));
}

Expand Down

0 comments on commit 8531783

Please sign in to comment.