I'm running some Scala code (with Java socialAuth library) that requires an HTTPServletRequest to be passed in as a param. 

```
def myClass(prov: String, site: String, request: HttpServletRequest): {
    //some initial code here

    val session = request.getSession()
    session.setAttribute(/*some params*/)

    //code continues...

}

```

So the HttpServletRequest seems like a really cool way of storing session variables and passing a session between methods. However, I'm not quite sure how to test this code, as I don't really understand what the HttpServletRequest interface *is*.

I've done a bit of research, but I was wondering if anyone could clarify for me. [HttpServletRequest](http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html) is an interface, which means it can't be instantiated on its own. How, then is it used in code? 

EDIT: as in, when a method takes an HttpServletRequest as a parameter, what implementing class is usually passed in? 

---

FOLLOWUP: Based on the answers given, HttpServletRequest is implemented differently by different servers; Ireeder pointed out, for example, that Apache even has multiple implementations. How, then, does code specify that the server needs to use its implementation? In other words, lets say I have test code that uses myClass:

```
def otherClass(){
    val site = "www.example.com"
    val provider = "twitter"
    val mockRequest = mock(HttpServletRequest.class)   //using https://code.google.com/p/mockito/.  (eclipse throws error..not too sure about syntax but throwing up this example quickly, so will edit later)

    myClass(provider, site, mockRequest)
    }

```

I assume this is OK for testing, as Mockito creates a mock object, but when otherClass() needs to be implemented on a server, how is its code adjusted? (Sorry, I'm a bit new at this, so bear with me...) If `val mockRequest` needs to be implemented with whatever HttpServletRequest implementation is used by the server (Apache, Oracle, etc), how does the user specify this in `otherClass`? Will something like this change:

```
//deleted line: --val mockRequest = mock(HttpServletRequest.class)
//changed line:  myClass(provider, site, mockRequest) to below:

myClass(provider, site, javax.servlet.http.HttpServletRequest) 

```

be interpreted and implemented correctly by the server?