Use method references when possible in test code

See gh-40974
This commit is contained in:
Ahmed Ashour
2024-06-11 12:51:35 -07:00
committed by Phillip Webb
parent dcccb3b2b1
commit 207327d97c
34 changed files with 64 additions and 48 deletions

View File

@@ -297,7 +297,7 @@ class FileSystemWatcherTests {
private void setupWatcher(long pollingInterval, long quietPeriod, SnapshotStateRepository snapshotStateRepository) {
this.watcher = new FileSystemWatcher(false, Duration.ofMillis(pollingInterval), Duration.ofMillis(quietPeriod),
snapshotStateRepository);
this.watcher.addListener((changeSet) -> FileSystemWatcherTests.this.changes.add(changeSet));
this.watcher.addListener(FileSystemWatcherTests.this.changes::add);
}
private File startWithNewDirectory() {