From bab1c530d01f413669018568a1c58ee8e946e0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Sier=C5=BC=C4=99ga?= Date: Wed, 20 Oct 2021 01:02:36 +0200 Subject: [PATCH] DaoAuthenticationProviderTests#avg returns fraction --- .../authentication/dao/DaoAuthenticationProviderTests.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java b/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java index 73056c57fcc..1771721b7f0 100644 --- a/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java +++ b/core/src/test/java/org/springframework/security/authentication/dao/DaoAuthenticationProviderTests.java @@ -462,11 +462,7 @@ public void IGNOREtestSec2056() { } private double avg(List counts) { - long sum = 0; - for (Long time : counts) { - sum += time; - } - return sum / counts.size(); + return counts.stream().mapToLong(Long::longValue).average().orElse(0); } @Test