### Question:
MockGateway implements ClientOut { @Override public void createNewAddressCommand(CreateNewAddressCommand createNewAddressCommand) { mockServer.createNewAddressCommand(createNewAddressCommand); } MockGateway(ClientIn clientIn); void sourceAddress(long sourceAddress); @Override void newOrderCommand(NewOrderCommand newOrderCommand); @Override void cancelOrderCommand(CancelOrderCommand cancelOrderCommand); @Override void createNewAddressCommand(CreateNewAddressCommand createNewAddressCommand); @Override void transferValueCommand(TransferValueCommand transferValueCommand); @Override void clusterTransferStep1Command(ClusterTransferStep1Command clusterTransferStep1Command); @Override void subscriptionQuery(SubscriptionQuery subscriptionQuery); @Override void clusterStatusQuery(ClusterStatusQuery clusterStatusQuery); @Override void clustersStatusQuery(ClustersStatusQuery clustersStatusQuery); @Override void currentBalanceQuery(CurrentBalanceQuery currentBalanceQuery); @Override void exchangeRateQuery(ExchangeRateQuery exchangeRateQuery); @Override void close();  }### Answer:
@Test public void createNewAddressCommand() throws IllegalAccessException { ThreadLocalRandom.current().nextInt(); Jvm.getField(Thread.class, "threadLocalRandomSeed") .setLong(Thread.currentThread(), 1); StringWriter out = new StringWriter(); ClientIn clientIn = Mocker.logging(ClientIn.class, "", out); MockGateway mg = new MockGateway(clientIn); Bytes<byte[]> publicKey = Bytes.wrapForRead(new byte[32]); mg.createNewAddressCommand(new CreateNewAddressCommand(1, 0, publicKey, "IE-A")); mg.createNewAddressCommand(new CreateNewAddressCommand(1, 0, publicKey, "IE-CO")); mg.createNewAddressCommand(new CreateNewAddressCommand(1, 0, publicKey, "IE-D")); mg.createNewAddressCommand(new CreateNewAddressCommand(1, 0, publicKey, "IE-DL")); assertEquals("commandFailedEvent[!CommandFailedEvent {\n" + " sourceAddress: ooooooooooooi,\n" + " eventTime: 0,\n" + " origSourceAddress: oooooooooooo2,\n" + " origEventTime: 0,\n" + " origProtocol: \"1\",\n" + " origMessageType: \"32\",\n" + " reason: Unknown region code IEA\n" + "}\n" + "]\n" + "createNewAddressEvent[!CreateNewAddressEvent {\n" + " sourceAddress: ooooooooooooi,\n" + " eventTime: 0,\n" + " origSourceAddress: oooooooooooo2,\n" + " origEventTime: 0,\n" + " address: iecooqflzupcn,\n" + " publicKey: !!binary AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n" + "}\n" + "]\n" + "createNewAddressEvent[!CreateNewAddressEvent {\n" + " sourceAddress: ooooooooooooi,\n" + " eventTime: 0,\n" + " origSourceAddress: oooooooooooo2,\n" + " origEventTime: 0,\n" + " address: ied2hsmj3yz5n,\n" + " publicKey: !!binary AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n" + "}\n" + "]\n" + "createNewAddressEvent[!CreateNewAddressEvent {\n" + " sourceAddress: ooooooooooooi,\n" + " eventTime: 0,\n" + " origSourceAddress: oooooooooooo2,\n" + " origEventTime: 0,\n" + " address: iedlspl6chtda,\n" + " publicKey: !!binary AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n" + "}\n" + "]\n", out.toString() .replaceAll("\r", "")); }