### Question:
ModeUtil { public static boolean isClassic(SlingHttpServletRequest request) { return AuthoringUIMode.CLASSIC == AuthoringUIMode.fromRequest(request); }  static WCMMode getMode(SlingHttpServletRequest req); static boolean isAuthor(); static boolean isPublish(); static boolean isRunmode(String mode); static boolean isAnalytics(SlingHttpServletRequest request); static boolean isDesign(SlingHttpServletRequest request); static boolean isDisabled(SlingHttpServletRequest request); static boolean isEdit(SlingHttpServletRequest request); static boolean isPreview(SlingHttpServletRequest request); static boolean isReadOnly(SlingHttpServletRequest request); static boolean isClassic(SlingHttpServletRequest request); static boolean isTouch(SlingHttpServletRequest request); static synchronized void configure(SlingSettingsService slingSettings);  }### Answer:
@Test public void testIsClassic() { when(request.getAttribute(AuthoringUIMode.REQUEST_ATTRIBUTE_NAME)).thenReturn(AuthoringUIMode.CLASSIC); assertTrue(ModeUtil.isClassic(request)); verify(request, atLeast(1)).getAttribute(AuthoringUIMode.class.getName()); verifyNoMoreInteractions(request); }
@Test public void testIsNotClassic() { when(request.getAttribute(AuthoringUIMode.REQUEST_ATTRIBUTE_NAME)).thenReturn(AuthoringUIMode.TOUCH); assertFalse(ModeUtil.isClassic(request)); verify(request, atLeast(1)).getAttribute(AuthoringUIMode.class.getName()); verifyNoMoreInteractions(request); }