@Test
public void testCategoricalNode() throws Exception {

  Node node = new CategoricalNode(rng.nextInt(), new double[]{rng.nextDouble(),
      rng.nextDouble(), rng.nextDouble()}, new Node[]{
      new Leaf(rng.nextDouble()), new Leaf(rng.nextDouble()),
      new Leaf(rng.nextDouble())});
  node.write(out);
  assertEquals(node, readNode());
}