public static ResourceId relativize(ResourceId base, ResourceId child) {
        checkArgument(child.nodeKeys().size() >= base.nodeKeys().size(),
                      "%s path must be deeper than base prefix %s", child, base);
        @SuppressWarnings("rawtypes")
        Iterator<NodeKey> bIt = base.nodeKeys().iterator();
        @SuppressWarnings("rawtypes")
        Iterator<NodeKey> cIt = child.nodeKeys().iterator();
        while (bIt.hasNext()) {
            NodeKey<?> b = bIt.next();
            NodeKey<?> c = cIt.next();

            checkArgument(Objects.equals(b, c),
                          "%s is not a prefix of %s.\n" +
                                  "b:%s != c:%s",
                          base, child,
                          b, c);
        }

        return ResourceId.builder().append(child.nodeKeys().subList(base.nodeKeys().size(),
                                                                    child.nodeKeys().size())).build();
    }
@Test
    public void testRelativizeEmpty() {
        ResourceId relDevices = ResourceIds.relativize(DEVICES, DEVICES);
        // equivalent of . in file path, expressed as ResourceId with empty
        assertTrue(relDevices.nodeKeys().isEmpty());

    }