@CheckForNull
    public View getView(final String name) {

        ViewGroup group = Jenkins.get();
        View view = null;

        final StringTokenizer tok = new StringTokenizer(name, "/");
        while (tok.hasMoreTokens()) {

            String viewName = tok.nextToken();

            view = group.getView(viewName);
            if (view == null) {
                group.checkPermission(View.READ);
                throw new IllegalArgumentException(String.format(
                        "No view named %s inside view %s",
                        viewName, group.getDisplayName()
                ));
            }
            view.checkPermission(View.READ);
            if (view instanceof ViewGroup) {
                group = (ViewGroup) view;
            } else if (tok.hasMoreTokens()) {
                throw new IllegalStateException(view.getViewName() + " view can not contain views");
            }
        }

        return view;
    }
@Test public void reportViewSpaceNameRequestAsIAE() {
        Jenkins jenkins = mock(Jenkins.class);
        try (MockedStatic<Jenkins> mocked = mockStatic(Jenkins.class)) {
            mockJenkins(mocked, jenkins);
            final IllegalArgumentException e = assertThrows("No exception thrown. Expected IllegalArgumentException",
                    IllegalArgumentException.class, () -> assertNull(handler.getView(" ")));
            assertEquals("No view named   inside view Jenkins", e.getMessage());
            verifyNoInteractions(setter);
        }
    }