code: @SuppressWarnings({ "rawtypes", "unchecked" })
      protected <T> Response<T> getAndRemoveResponse(final String correlationId) {
          synchronized (responseMap) {
              final List<Response<T>> responseList = (List) responseMap.get(correlationId);
              if (responseList == null)
                  return null;
              final Response<T> response = responseList.remove(responseList.size() - 1);
              if (responseList.isEmpty()) {
                  responseMap.remove(correlationId);
              }
              return response;
          }
      }
docs: Gets and removes a response 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 response shall be get
  @param <T>
  type of data holt in the response
  @return the response or null, if no response for the specified correlation id is found