Simplify map-building logic

This commit is contained in:
Jon Chambers 2021-09-29 10:55:58 -04:00 committed by Jon Chambers
parent e333cbd94d
commit c6bb649adb
1 changed files with 1 additions and 3 deletions

View File

@ -44,9 +44,7 @@ public class AuthEnablementRefreshRequirementProvider implements WebsocketRefres
@VisibleForTesting
Map<Long, Boolean> buildDevicesEnabledMap(final Account account) {
return account.getDevices().stream()
.collect(() -> new HashMap<>(account.getDevices().size()),
(map, device) -> map.put(device.getId(), device.isEnabled()), HashMap::putAll);
return account.getDevices().stream().collect(Collectors.toMap(Device::getId, Device::isEnabled));
}
@Override