@Test public void testCopy() { Snowflake p1 = new Snowflake(new Snowflake.SnowflakeParameters(60, 5, 7, 4.0 / 7.0, 3, nb, nl)); Snowflake p2 = p1.copy(); p1.init(); p1.network().runMs(200); p2.init(); p2.network().runMs(200); for (Snowflake.SnowflakeNode n1 : p1.network().allNodes) { Snowflake.SnowflakeNode n2 = p2.network().getNodeById(n1.nodeId); Assert.assertNotNull(n2); Assert.assertEquals(n1.myColor, n2.myColor); Assert.assertEquals(n1.myQueryNonce, n2.myQueryNonce); Assert.assertEquals(n1.cnt, n2.cnt); } }
@Override public Snowflake copy() { return new Snowflake(params); }
Snowflake implements Protocol { @Override public Snowflake copy() { return new Snowflake(params); } }
Snowflake implements Protocol { @Override public Snowflake copy() { return new Snowflake(params); } Snowflake(SnowflakeParameters params); }
Snowflake implements Protocol { @Override public Snowflake copy() { return new Snowflake(params); } Snowflake(SnowflakeParameters params); @Override Snowflake copy(); @Override void init(); @Override Network<SnowflakeNode> network(); @Override String toString(); static void main(String... args); }
Snowflake implements Protocol { @Override public Snowflake copy() { return new Snowflake(params); } Snowflake(SnowflakeParameters params); @Override Snowflake copy(); @Override void init(); @Override Network<SnowflakeNode> network(); @Override String toString(); static void main(String... args);  }