class RocksDBIncrementalCheckpointUtils {

	@Nullable
	public static KeyedStateHandle chooseTheBestStateHandleForInitial(
		@Nonnull Collection<KeyedStateHandle> restoreStateHandles,
		@Nonnull KeyGroupRange targetKeyGroupRange) {

		KeyedStateHandle bestStateHandle = null;
		double bestScore = 0;
		for (KeyedStateHandle rawStateHandle : restoreStateHandles) {
			double handleScore = STATE_HANDLE_EVALUATOR.apply(rawStateHandle, targetKeyGroupRange);
			if (handleScore > bestScore) {
				bestStateHandle = rawStateHandle;
				bestScore = handleScore;
			}
		}

		return bestStateHandle;
	}

}