I want to stream a collection X into two separate collections A and B depending on whether the items in x pass a predicate
A classic problem!

You can use the `partition` method to achieve this. Here's an example:
```
val x: Collection[ItemType] =... // your collection X

val (a, b) = x.partition(predicate)

// a: Collection[ItemType] - items that pass the predicate
// b: Collection[ItemType] - items that don't pass the predicate
```
The `partition` method takes a predicate function as an argument and returns a tuple of two collections: the first collection contains all elements that satisfy the predicate, and the second collection contains all elements that don't satisfy the predicate.

For example, if you have a collection of integers and you want to separate them into two collections: one for even numbers and one for odd numbers:
```
val x: List[Int] = List(1, 2, 3, 4, 5, 6)

val (even, odd) = x.partition(_ % 2 == 0)

// even: List(2, 4, 6)
// odd: List(1, 3, 5)
```
Note that `partition` returns a tuple, so you can use pattern matching to extract the two collections.

Alternatively, you can use `filter` and `filterNot` methods to achieve the same result:
```
val a: Collection[ItemType] = x.filter(predicate)
val b: Collection[ItemType] = x.filterNot(predicate)
```
However,
I want to stream a collection X into two separate collections A and B depending on whether the items in x pass a predicate or not.

Here's a solution that uses `partition`:

```scss
let A = x.filter(predicate).toList()
let B = x.filterNot(predicate).toList()
```

This solution uses `filter` to separate the items in `x` into two lists based on whether they pass the predicate or not. The `toList()` method is used to convert the streams back into lists.

If you want to keep the items in their original order, you can use `partition` instead of `filter` and `filterNot`:

```scss
let (passing, failing) = x.partition(predicate)
let A = passing.toList()
let B = failing.toList()
```

In this solution, `partition` splits `x` into two lists: one containing the items that pass the predicate, and one containing the items that do not. The `toList()` method is used to convert the streams back into lists.

Here's an example of using `partition`:

```scss
let numbers = Stream.fromIterable([1, 2, 3, 4, 5])
let (even, odd) = numbers.partition(n => n % 2 === 0)

let A = even