added missing unittests
replaced anonymous classes with Java 8 lambdas