@@ -0,0 +1,1763 @@
+package com.github.pedrovgs.problem47;%0A%0Aimport com.github.pedrovgs.binarytree.BinaryNode;%0Aimport com.github.pedrovgs.problem46.BinaryTreeSerialization;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * @author Pedro Vicente G%C3%B3mez S%C3%A1nchez.%0A */%0Apublic class BinaryTreeSerializationTest %7B%0A%0A  private BinaryTreeSerialization binaryTreeSerialization;%0A%0A  @Before public void setUp() %7B%0A    binaryTreeSerialization = new BinaryTreeSerialization();%0A  %7D%0A%0A  @Test(expected = IllegalArgumentException.class)%0A  public void shouldNotAcceptNullBinaryTreesToSerialize() %7B%0A    binaryTreeSerialization.serialize(null);%0A  %7D%0A%0A  @Test(expected = IllegalArgumentException.class)%0A  public void shouldNotAcceptNullStringsToDeserialize() %7B%0A    binaryTreeSerialization.deserialize(null);%0A  %7D%0A%0A  @Test public void shouldSerializeAndDeserializeTreeWithJustOneElement() %7B%0A    BinaryNode%3CInteger%3E root = new BinaryNode%3CInteger%3E(0);%0A%0A    String serializedTree = binaryTreeSerialization.serialize(root);%0A    BinaryNode%3CInteger%3E deserializedTree = binaryTreeSerialization.deserialize(serializedTree);%0A%0A    assertEquals(root, deserializedTree);%0A  %7D%0A%0A  @Test public void shouldSerializeAndDeserializeTreeWithMoreThanOneElement() %7B%0A    BinaryNode%3CInteger%3E root = new BinaryNode%3CInteger%3E(0);%0A    BinaryNode%3CInteger%3E n1 = new BinaryNode%3CInteger%3E(1);%0A    BinaryNode%3CInteger%3E n2 = new BinaryNode%3CInteger%3E(2);%0A    BinaryNode%3CInteger%3E n3 = new BinaryNode%3CInteger%3E(3);%0A    root.setLeft(n1);%0A    root.setRight(n2);%0A    n2.setLeft(n3);%0A%0A    String serializedTree = binaryTreeSerialization.serializeInner(root);%0A    BinaryNode%3CInteger%3E deserializedTree = binaryTreeSerialization.deserialize(serializedTree);%0A%0A    assertEquals(root, deserializedTree);%0A  %7D%0A%7D%0A

Add some tests to problem 47