### Question:
ModeUtil { public static boolean isDisabled(SlingHttpServletRequest request) { return WCMMode.DISABLED == getMode(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 testIsDisabled() { when(request.getAttribute(WCMMode.class.getName())).thenReturn(WCMMode.DISABLED); assertTrue(ModeUtil.isDisabled(request)); verify(request, atLeast(1)).getAttribute(WCMMode.class.getName()); verifyNoMoreInteractions(request); }
@Test public void testIsNotDisabled() { when(request.getAttribute(WCMMode.class.getName())).thenReturn(WCMMode.EDIT); assertFalse(ModeUtil.isDisabled(request)); verify(request, atLeast(1)).getAttribute(WCMMode.class.getName()); verifyNoMoreInteractions(request); }