### What are you really trying to do? <!-- Tell us at a high level what you're doing, to avoid XY problem (https://en.wikipedia.org/wiki/XY_problem) --> ### Describe the bug If signal is received when currentRecords is empty instead of null then it will not add it to `recordsToRemove` list which is causing `Workflow.await(() -> currentRecords.size() == 0);` to wait indefinite https://github.com/temporalio/samples-java/blob/main/core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java#L130 Current Code ``` if (currentRecords == null) { recordsToRemove.add(recordId); return; } ``` Expected change ``` if (currentRecords == null || currentRecords.isEmpty()) { recordsToRemove.add(recordId); return; } ``` <!-- A clear and concise description of what the bug is. --> <!-- If applicable, add screenshots or code blocks to help explain your problem. You can also use [Loom](http://loom.com/) to do short, free video bug reports. --> ### Minimal Reproduction <!-- Modify our hello world templates to demonstrate: * TypeScript: https://github.com/temporalio/samples-typescript/tree/main/hello-world * Go: https://github.com/temporalio/money-transfer-project-template-go * Java: https://github.com/temporalio/money-transfer-project-template-java * PHP: https://github.com/temporalio/samples-php#samples --> ### Environment/Versions <!-- Please complete the following information where relevant. --> * OS and processor: [e.g. M1 Mac, x86 Windows, Linux] * Temporal Version: [e.g. 1.14.0?] and/or SDK version * Are you using Docker or Kubernetes or building Temporal from source? ### Additional context <!-- Add any other context about the problem here. -->
What are you really trying to do?
Describe the bug
If signal is received when currentRecords is empty instead of null then it will not add it to
recordsToRemovelist which is causingWorkflow.await(() -> currentRecords.size() == 0);to wait indefinitehttps://github.com/temporalio/samples-java/blob/main/core/src/main/java/io/temporal/samples/batch/slidingwindow/SlidingWindowBatchWorkflowImpl.java#L130
Current Code
Expected change
Minimal Reproduction
Environment/Versions
Additional context