diff --git a/src/test/java/permissions/TestPermissions.java b/src/test/java/permissions/TestPermissions.java index eebcf215e..0220a02a5 100644 --- a/src/test/java/permissions/TestPermissions.java +++ b/src/test/java/permissions/TestPermissions.java @@ -8,6 +8,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.util.Objects; import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -66,14 +67,12 @@ public class TestPermissions { assertTrue(player.hasPermission("perm.name")); assertTrue(player.hasPermission("perm.name", nbtCompound -> { - if (nbtCompound != null && nbtCompound.containsKey("name")) { - return nbtCompound.getString("name").equals("Minestom"); - } - return false; + final String name = nbtCompound != null ? nbtCompound.getString("name") : null; + return Objects.equals(name, "Minestom"); })); player.addPermission(permission2); - assertFalse(player.hasPermission("perm.name2", nbtCompound -> nbtCompound != null)); + assertFalse(player.hasPermission("perm.name2", Objects::nonNull)); } @AfterEach