OAuth2StateUtil { public static Optional<OAuth2State> getOAuth2StateOptional( HttpServletRequest httpServletRequest) { HttpSession httpSession = httpServletRequest.getSession(); return Optional.ofNullable( (OAuth2State)httpSession.getAttribute( _SESSION_ATTRIBUTE_NAME_GOOGLE_OAUTH2_STATE)); }  static void cleanUp(HttpServletRequest httpServletRequest); static Optional<OAuth2State> getOAuth2StateOptional(
		HttpServletRequest httpServletRequest); static String getRedirectURI(String portalURL); static boolean isValid(
		OAuth2State oAuth2State, HttpServletRequest httpServletRequest); static void save(
		HttpServletRequest httpServletRequest, OAuth2State oAuth2State);  }
@Test public void testGetOAuth2StateOptionalWithNullState() { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); MockHttpSession mockHttpSession = new MockHttpSession(); mockHttpServletRequest.setSession(mockHttpSession); Optional<OAuth2State> oAuth2StateOptional = OAuth2StateUtil.getOAuth2StateOptional(mockHttpServletRequest); Assert.assertFalse(oAuth2StateOptional.isPresent()); }