code: @SuppressWarnings({ "rawtypes", "unchecked" })
      protected <T> List<Response<T>> getAndRemoveResponses(final String correlationId) {
          synchronized (responseMap) {
              final List rv = responseMap.remove(correlationId);
              return rv == null ? Collections.emptyList() : new ArrayList(rv);
          }
      }
docs: Gets and removes all responses for the specified correlation id
  <p>
  <b>Attention</b>: When a workflow instance is resumed after a <code>Workflow.wait</code> call, all corresponding
  responses for this workflow instance in the storage are read. Each of these responses that you do NOT retrieve
  using {@link Workflow#getAndRemoveResponse(String)} or {@link Workflow#getAndRemoveResponses(String)} are
  discarded when calling the next <code>Workflow.wait</code>
  
  @param correlationId
  correlation id for which responses shall be get
  @param <T>
  type of data holt in the response
  @return the list of responses or an empty list, if no response for the specified correlation id is found