public boolean matches(List<ItemPointer> itemPointers, String privateCreator, int tag) {
        int level;
        if (tag != this.tag || !Objects.equals(privateCreator, this.privateCreator)
                || (itemPointers.size() != (level = level()))) {
            return false;
        }
        for (int i = 0; i < level; i++) {
            ItemPointer itemPointer = itemPointers.get(i);
            ItemPointer other = itemPointer(i);
            if (!(itemPointer.itemIndex < 0 || other.itemIndex < 0
                    ? itemPointer.equalsIgnoreItemIndex(other)
                    : itemPointer.equals(other))) {
                return false;
            }
        }
        return true;
    }
@Test
    public void testMatches() {
        ItemPointer ip = new ItemPointer(Tag.RequestAttributesSequence);
        AttributeSelector selector = new AttributeSelector(Tag.StudyInstanceUID, null, ip);
        assertTrue(selector.matches(Collections.singletonList(ip), null, Tag.StudyInstanceUID));
    }