    public void testBasicExceptions() throws IOException, ClassNotFoundException {
        ShardId id = new ShardId("foo", 1);
        DiscoveryNode src = new DiscoveryNode("someNode", new InetSocketTransportAddress("127.0.0.1", 6666), Version.CURRENT);
        DiscoveryNode target = new DiscoveryNode("otherNode", new InetSocketTransportAddress("127.0.0.1", 8888), Version.CURRENT);

        RecoveryFailedException ex = new RecoveryFailedException(id, src, target, new AlreadyClosedException("closed", new SecurityException("booom booom boom", new FileNotFoundException("no such file"))));
        RecoveryFailedException serialize = serialize(ex);
        assertEquals(ex.getMessage(), serialize.getMessage());
        assertEquals(AlreadyClosedException.class, serialize.getCause().getClass());
        assertEquals(SecurityException.class, serialize.getCause().getCause().getClass());
        assertEquals(FileNotFoundException.class, serialize.getCause().getCause().getCause().getClass());
        ConnectTransportException tpEx = new ConnectTransportException(src, "foo", new IllegalArgumentException("boom"));
        ConnectTransportException serializeTpEx = serialize(tpEx);
        assertEquals(tpEx.getMessage(), serializeTpEx.getMessage());
        assertEquals(src, tpEx.node());

        TestException testException = new TestException(Arrays.asList("foo"), EnumSet.allOf(IndexShardState.class), ImmutableMap.<String,String>builder().put("foo", "bar").build(), InetAddress.getByName("localhost"), new Number[] {new Integer(1)});
        assertEquals(serialize(testException).list.get(0), "foo");
        assertTrue(serialize(testException).set.containsAll(Arrays.asList(IndexShardState.values())));
        assertEquals(serialize(testException).map.get("foo"), "bar");
    }
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.