NetworkLoggingDecorator implements Network, PerformanceLogger, Closeable { @Override public int getNoOfParties() { return delegate.getNoOfParties(); } NetworkLoggingDecorator(Network network); protected  NetworkLoggingDecorator(Network network, Map<Integer, PartyStats> partyStatsMap); @Override byte[] receive(int partyId); @Override int getNoOfParties(); @Override void send(int partyId, byte[] data); @Override void reset(); @Override void close(); @Override Map<String, Long> getLoggedValues(); static final String NETWORK_PARTY_BYTES; static final String NETWORK_TOTAL_BYTES; static final String NETWORK_TOTAL_BATCHES; }
@Test public void getNoOfParties() throws Exception { NetworkLoggingDecorator networkLoggingDecorator = new NetworkLoggingDecorator(new Network() { @Override public void send(int partyId, byte[] data) { } @Override public byte[] receive(int partyId) { return new byte[0]; } @Override public int getNoOfParties() { return 22; } }); assertThat(networkLoggingDecorator.getNoOfParties(), is(22)); networkLoggingDecorator.close(); }