@Test
public void getRequestAttributeTest() {

    HttpServletRequest request = mock(HttpServletRequest.class);
    when(request.getAttribute("myobject")).thenReturn(new TestObject());
    Assert.assertTrue(HttpUtil.getRequestAttribute(request, "myobject") instanceof TestObject);
    Assert.assertTrue(HttpUtil.getRequestAttribute(request, "foo") == null);
}