@Override
    public ContainerItem getContainer(final Path file) {
        Deque<Path> pathDeque = decompose(file);

        Path lastContainer = null;
        Path lastCollection = null;
        boolean exit = false, nextExit = false, exitEarly = false;

        while(!exit && pathDeque.size() > 0) {
            final Path current = pathDeque.pop();
            exit = nextExit;
            nextExit = exitEarly;

            switch(current.getName()) {
                case DRIVES_CONTAINER:
                    nextExit = true;
                case SITES_CONTAINER:
                    lastCollection = current;
                    break;

                case GROUPS_CONTAINER:
                    lastCollection = current;
                    exitEarly = true;
                    break;

                default:
                    lastContainer = current;
            }
        }

        return new ContainerItem(lastContainer, lastCollection, exit);
    }
@Test
    public void testContainerEquality() {
        final Path source = new Path("/Default/Drives/Docs", EnumSet.of(Path.Type.directory))
                .withAttributes(new PathAttributes()
                        .withFileId("File Id"));
        final Path target = new Path("/Default/Drives/Docs", EnumSet.of(Path.Type.directory));
        final GraphSession.ContainerItem sourceItem = session.getContainer(source);
        final GraphSession.ContainerItem targetItem = session.getContainer(target);
        assertEquals(sourceItem, targetItem);
    }