### Question:
MeshOrganizer implements Serializable { public Node addNode(@NonNull String ip) { return addNode(ip, 40123); } MeshOrganizer(); @Deprecated  MeshOrganizer(@NonNull MeshBuildMode mode); long getVersion(); Node addNode(@NonNull String ip); Node addNode(@NonNull String ip, @NonNull int port); MeshOrganizer clone(); synchronized Node addNode(@NonNull Node node); void markNodeOffline(@NonNull String ip); void markNodeOffline(@NonNull Node node); @Override boolean equals(Object o); @Override int hashCode(); void remapNode(@NonNull String ip); void remapNodeAndDownstreams(@NonNull String ip); synchronized void remapNodeAndDownstreams(@NonNull Node node); synchronized void remapNode(@NonNull Node node); void removeNode(); boolean isKnownNode(@NonNull String id); Node getUpstreamForNode(@NonNull String ip); Collection<Node> getDownstreamsForNode(@NonNull String ip); long numberOfDescendantsOfNode(); long totalNodes(); Collection<Node> flatNodes(); Node getNodeById(@NonNull String id); static final int MAX_DOWNSTREAMS; static final int MAX_DEPTH; }### Answer:
@Test public void testEquality_4() throws Exception { val mesh1 = new MeshOrganizer(MeshBuildMode.MESH); val mesh2 = new MeshOrganizer(MeshBuildMode.MESH); val mesh3 = new MeshOrganizer(MeshBuildMode.PLAIN); mesh1.addNode("192.168.1.1"); mesh2.addNode("192.168.1.1"); mesh3.addNode("192.168.1.1"); assertEquals(mesh1, mesh2); assertNotEquals(mesh1, mesh3); }
@Test public void testSerialization_1() throws Exception { val mesh1 = new MeshOrganizer(MeshBuildMode.MESH); for (int e = 0; e < 1000; e++) mesh1.addNode(java.util.UUID.randomUUID().toString()); try(val baos = new ByteArrayOutputStream();) { SerializationUtils.serialize(mesh1, baos); try(val bais = new ByteArrayInputStream(baos.toByteArray())) { MeshOrganizer mesh2 = SerializationUtils.deserialize(bais); assertEquals(mesh1, mesh2); } } }