diff --git a/src/test/java/com/github/underscore/LodashTest.java b/src/test/java/com/github/underscore/LodashTest.java index 837f0377..7a47cb4c 100644 --- a/src/test/java/com/github/underscore/LodashTest.java +++ b/src/test/java/com/github/underscore/LodashTest.java @@ -413,8 +413,7 @@ void set() { U.set( (Map) U.fromJson("{\"a\":[{\"b\":{\"c\":\"d\"}}]}"), "a[0].b.c", - "e") - .toString()); + "e")); assertEquals( "{b={c=d}}", U.set( @@ -428,7 +427,7 @@ void set() { map.put("a", map2); map2.put("#item", map3); map3.put("b", "c"); - assertEquals("c", U.set(map, "a.b", "b").toString()); + assertEquals("c", U.set(map, "a.b", "b")); assertNull(U.set((Map) null, "a", "b")); assertNull(U.set(new LinkedHashMap(), "a.b", "b")); Map map4 = new LinkedHashMap<>(); diff --git a/src/test/java/com/github/underscore/ObjectsTest.java b/src/test/java/com/github/underscore/ObjectsTest.java index 69f380c3..9cc8174f 100644 --- a/src/test/java/com/github/underscore/ObjectsTest.java +++ b/src/test/java/com/github/underscore/ObjectsTest.java @@ -174,7 +174,7 @@ void pick() { put("userid", "moe1"); } }, - value -> value instanceof Number); + Number.class::isInstance); assertEquals("[age=50]", result2.toString()); } @@ -208,7 +208,7 @@ void omit() { put("userid", "moe1"); } }, - value -> value instanceof Number); + Number.class::isInstance); assertEquals("[name=moe, userid=moe1]", result2.toString()); } diff --git a/src/test/java/com/github/underscore/UnderscoreTest.java b/src/test/java/com/github/underscore/UnderscoreTest.java index c3bc1f83..2d8b32a5 100644 --- a/src/test/java/com/github/underscore/UnderscoreTest.java +++ b/src/test/java/com/github/underscore/UnderscoreTest.java @@ -166,9 +166,9 @@ void push() { @SuppressWarnings("unchecked") @Test void pop() { - assertEquals("c", Underscore.pop(asList("a", "b", "c")).getKey().toString()); + assertEquals("c", Underscore.pop(asList("a", "b", "c")).getKey()); assertEquals("c", new Underscore(asList("a", "b", "c")).pop().getKey().toString()); - assertEquals("c", Underscore.chain(asList("a", "b", "c")).pop().item().getKey().toString()); + assertEquals("c", Underscore.chain(asList("a", "b", "c")).pop().item().getKey()); } /* @@ -178,7 +178,7 @@ void pop() { @SuppressWarnings("unchecked") @Test void shift() { - assertEquals("a", Underscore.shift(asList("a", "b", "c")).getKey().toString()); + assertEquals("a", Underscore.shift(asList("a", "b", "c")).getKey()); assertEquals("a", new Underscore(asList("a", "b", "c")).shift().getKey().toString()); assertEquals( "a", Underscore.chain(asList("a", "b", "c")).shift().item().getKey().toString()); @@ -541,7 +541,7 @@ void optional() { assertEquals("1", Optional.of(1).orElse(null).toString()); assertFalse(Optional.empty().map(arg -> "" + arg).isPresent()); assertTrue(Optional.empty().map(arg -> "" + arg).isEmpty()); - assertEquals("1", Optional.of(1).map(arg -> "" + arg).get().toString()); + assertEquals("1", Optional.of(1).map(arg -> "" + arg).get()); try { Optional.empty().get(); fail("IllegalStateException expected");