OAuth2StateUtil { public static void save( HttpServletRequest httpServletRequest, OAuth2State oAuth2State) { HttpSession httpSession = httpServletRequest.getSession(); httpSession.setAttribute( _SESSION_ATTRIBUTE_NAME_GOOGLE_OAUTH2_STATE, oAuth2State); }  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 testSave() { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); String state = RandomTestUtil.randomString(); OAuth2State initialOAuth2State = new OAuth2State( RandomTestUtil.randomLong(), RandomTestUtil.randomString(), RandomTestUtil.randomString(), state); OAuth2StateUtil.save(mockHttpServletRequest, initialOAuth2State); Optional<OAuth2State> oAuth2StateOptional = OAuth2StateUtil.getOAuth2StateOptional(mockHttpServletRequest); OAuth2State oAuth2State = oAuth2StateOptional.get(); _assertOAuth2State(initialOAuth2State, state, oAuth2State); }