Use final, valueOf(), lambdas.
This commit is contained in:
parent
7f7c3d63c8
commit
5a580fb9cb
|
@ -36,7 +36,7 @@ public class ArrayUtilsSetTest {
|
|||
assertArrayEquals(null, ArrayUtils.setAll(null, nullIntFunction));
|
||||
assertArrayEquals(ArrayUtils.EMPTY_BOOLEAN_OBJECT_ARRAY, ArrayUtils.setAll(ArrayUtils.EMPTY_BOOLEAN_OBJECT_ARRAY, nullIntFunction));
|
||||
assertArrayEquals(ArrayUtils.EMPTY_OBJECT_ARRAY, ArrayUtils.setAll(ArrayUtils.EMPTY_OBJECT_ARRAY, nullIntFunction));
|
||||
Integer[] array = new Integer[10];
|
||||
final Integer[] array = new Integer[10];
|
||||
final Integer[] array2 = ArrayUtils.setAll(array, Integer::valueOf);
|
||||
assertSame(array, array2);
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
|
@ -51,10 +51,10 @@ public class ArrayUtilsSetTest {
|
|||
assertArrayEquals(null, ArrayUtils.setAll(null, nullSupplier));
|
||||
assertArrayEquals(ArrayUtils.EMPTY_BOOLEAN_OBJECT_ARRAY, ArrayUtils.setAll(ArrayUtils.EMPTY_BOOLEAN_OBJECT_ARRAY, nullSupplier));
|
||||
assertArrayEquals(ArrayUtils.EMPTY_OBJECT_ARRAY, ArrayUtils.setAll(ArrayUtils.EMPTY_OBJECT_ARRAY, nullSupplier));
|
||||
String[] array = new String[10];
|
||||
final String[] array = new String[10];
|
||||
final String[] array2 = ArrayUtils.setAll(array, () -> StringUtils.EMPTY);
|
||||
assertSame(array, array2);
|
||||
for (String s : array) {
|
||||
for (final String s : array) {
|
||||
assertEquals(StringUtils.EMPTY, s);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class UncheckedExecutionExceptionTest {
|
|||
|
||||
@Test
|
||||
public void testConstructWithCause() {
|
||||
Exception e = new Exception();
|
||||
final Exception e = new Exception();
|
||||
assertSame(e, new UncheckedExecutionException(e).getCause());
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class UncheckedTimeoutExceptionTest {
|
|||
|
||||
@Test
|
||||
public void testConstructWithCause() {
|
||||
Exception e = new Exception();
|
||||
final Exception e = new Exception();
|
||||
assertSame(e, new UncheckedTimeoutException(e).getCause());
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class UncheckedExceptionTest {
|
|||
|
||||
@Test
|
||||
public void testConstructWithCause() {
|
||||
Exception e = new Exception();
|
||||
final Exception e = new Exception();
|
||||
assertSame(e, new UncheckedException(e).getCause());
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class UncheckedInterruptedExceptionTest {
|
|||
|
||||
@Test
|
||||
public void testConstructWithCause() {
|
||||
Exception e = new Exception();
|
||||
final Exception e = new Exception();
|
||||
assertSame(e, new UncheckedInterruptedException(e).getCause());
|
||||
}
|
||||
|
||||
|
|
|
@ -66,11 +66,8 @@ public class BooleanConsumerTest {
|
|||
assertFalse(aBool2.get());
|
||||
|
||||
// Check order
|
||||
final BooleanConsumer bad = new BooleanConsumer() {
|
||||
@Override
|
||||
public void accept(boolean value) {
|
||||
final BooleanConsumer bad = value -> {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
};
|
||||
final BooleanConsumer badComposite = bad.andThen(aBool2::lazySet);
|
||||
|
||||
|
|
Loading…
Reference in New Issue