@Override
    public MetadataNode child(String name) {
        if (name.equals("name")) {
            return new MetadataLeafNode(image.name());
        } else if (name.equals("id")) {
            return new MetadataLeafNode(image.id().toString());
        } else {
            int partitionId;
            try {
                partitionId = Integer.parseInt(name);
            } catch (NumberFormatException e) {
                return null;
            }
            PartitionRegistration registration = image.partitions().get(partitionId);
            if (registration == null) return null;
            return new MetadataLeafNode(registration.toString());
        }
    }
@Test
    public void testChildPartitionId() {
        MetadataNode child = NODE.child("0");
        assertNotNull(child);
        NodeStringifier stringifier = new NodeStringifier();
        child.print(stringifier);
        assertEquals("PartitionRegistration(replicas=[2, 3, 4], " +
                "directories=[AAAAAAAAAAAAAAAAAAAAAA, AAAAAAAAAAAAAAAAAAAAAA, AAAAAAAAAAAAAAAAAAAAAA], " +
                "isr=[2, 3], removingReplicas=[], addingReplicas=[], elr=[], lastKnownElr=[], leader=2, " +
                "leaderRecoveryState=RECOVERED, leaderEpoch=1, partitionEpoch=345)", stringifier.toString());
    }