BroadcastingNetworkProxy implements Network { @Override public void send(int partyId, byte[] data) { throw new UnsupportedOperationException("Broadcast network can only send to all"); } BroadcastingNetworkProxy(Network network, BroadcastValidation validator); @Override void send(int partyId, byte[] data); @Override byte[] receive(int partyId); @Override int getNoOfParties(); @Override void sendToAll(byte[] data); @Override List<byte[]> receiveFromAll();  }
@Test(expected = UnsupportedOperationException.class) public void testSendUnsupported() { validBroadcastNetwork.send(1, null); }