GridAffinityAssignmentV2 extends IgniteDataTransferObject implements AffinityAssignment { @Override public AffinityTopologyVersion topologyVersion() { return topVer; } GridAffinityAssignmentV2();   GridAffinityAssignmentV2(AffinityTopologyVersion topVer);  GridAffinityAssignmentV2(AffinityTopologyVersion topVer,
        List<List<ClusterNode>> assignment,
        List<List<ClusterNode>> idealAssignment
    );   GridAffinityAssignmentV2(AffinityTopologyVersion topVer, GridAffinityAssignmentV2 aff); @Override List<List<ClusterNode>> idealAssignment(); @Override List<List<ClusterNode>> assignment(); @Override AffinityTopologyVersion topologyVersion(); @Override List<ClusterNode> get(int part); @Override Collection<UUID> getIds(int part); @Override Set<ClusterNode> nodes(); @Override Set<ClusterNode> primaryPartitionNodes(); @Override Set<Integer> primaryPartitions(UUID nodeId); @Override Set<Integer> backupPartitions(UUID nodeId); @Override Set<Integer> partitionPrimariesDifferentToIdeal(); @Override int hashCode(); @SuppressWarnings("SimplifiableIfStatement") @Override boolean equals(Object o); @Override String toString();  }
@Test public void testSerialization() throws IOException, ClassNotFoundException { List<ClusterNode> nodes = new ArrayList<>(); for (int i = 0; i < 10; i++) nodes.add(node(metrics, ver, "1" + i)); GridAffinityAssignmentV2 gridAffinityAssignment2 = new GridAffinityAssignmentV2( new AffinityTopologyVersion(1, 0), new ArrayList<List<ClusterNode>>() {{ add(nodes); }}, new ArrayList<>() ); ByteArrayOutputStream byteArrOutputStream = new ByteArrayOutputStream(); ObjectOutputStream outputStream = new ObjectOutputStream(byteArrOutputStream); outputStream.writeObject(gridAffinityAssignment2); ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(byteArrOutputStream.toByteArray())); GridAffinityAssignmentV2 deserialized = (GridAffinityAssignmentV2)inputStream.readObject(); assertEquals(deserialized.topologyVersion(), gridAffinityAssignment2.topologyVersion()); }