@Test
public void getSessionAttributeTest() {

    HttpSession session = mock(HttpSession.class);
    when(session.getAttribute("myobject")).thenReturn(new TestObject());
    Assert.assertTrue(HttpUtil.getSessionAttribute(session, "myobject") instanceof TestObject);
    Assert.assertTrue(HttpUtil.getSessionAttribute(session, "foo") == null);
}