Refactor code to support building against Java 1.6

The code now compiles and tests with Java 1.6, too.

I kept source compatibility settings in `pom.xml` set to `1.7` though to preserve the existing Java version setup.

To verify you only need to change:

```xml
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
```

to

```xml
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
```

and -- after ensuring your JDK version in use is actually 1.6.x -- you can run `mvn clean test`.