code: private static void extractIntersectingState(
  		Collection<KeyedStateHandle> originalSubtaskStateHandles,
  		KeyGroupRange rangeToExtract,
  		List<KeyedStateHandle> extractedStateCollector) {
  
  		for (KeyedStateHandle keyedStateHandle : originalSubtaskStateHandles) {
  
  			if (keyedStateHandle != null) {
  
  				KeyedStateHandle intersectedKeyedStateHandle = keyedStateHandle.getIntersection(rangeToExtract);
  
  				if (intersectedKeyedStateHandle != null) {
  					extractedStateCollector.add(intersectedKeyedStateHandle);
  				}
  			}
  		}
  	}
docs: Extracts certain key group ranges from the given state handles and adds them to the collector.