Upgrade to junit 4.
diff --git a/pom.xml b/pom.xml
index 0644881..61f431e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -81,7 +81,7 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.1</version>
+      <version>[4.8,)</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
diff --git a/src/test/java/net/hydromatic/linq4j/expressions/TypeTest.java b/src/test/java/net/hydromatic/linq4j/expressions/TypeTest.java
index a3ba8b6..10ef815 100644
--- a/src/test/java/net/hydromatic/linq4j/expressions/TypeTest.java
+++ b/src/test/java/net/hydromatic/linq4j/expressions/TypeTest.java
@@ -17,13 +17,16 @@
 */
 package net.hydromatic.linq4j.expressions;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
 
 /**
  * Test for {@link Types#gcd}.
  */
-public class TypeTest extends TestCase {
-  public void testGcd() {
+public class TypeTest {
+  @Test public void testGcd() {
     int i = 0;
     char c = 0;
     byte b = 0;
diff --git a/src/test/java/net/hydromatic/linq4j/test/ExpressionTest.java b/src/test/java/net/hydromatic/linq4j/test/ExpressionTest.java
index 795bbd5..3dc6c36 100644
--- a/src/test/java/net/hydromatic/linq4j/test/ExpressionTest.java
+++ b/src/test/java/net/hydromatic/linq4j/test/ExpressionTest.java
@@ -20,19 +20,22 @@
 import net.hydromatic.linq4j.expressions.*;
 import net.hydromatic.linq4j.function.Function1;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.util.*;
 
+import static org.junit.Assert.*;
+
+
 /**
  * Unit test for {@link net.hydromatic.linq4j.expressions.Expression}
  * and subclasses.
  */
-public class ExpressionTest extends TestCase {
-  public void testLambdaCallsBinaryOp() {
+public class ExpressionTest {
+  @Test public void testLambdaCallsBinaryOp() {
     // A parameter for the lambda expression.
     ParameterExpression paramExpr =
         Expressions.parameter(Double.TYPE, "arg");
@@ -71,10 +74,10 @@
     //
     // arg => (arg +2)
     // 3
-    assertEquals(3.5D, n);
+    assertEquals(3.5D, n, 0d);
   }
 
-  public void testLambdaPrimitiveTwoArgs() {
+  @Test public void testLambdaPrimitiveTwoArgs() {
     // Parameters for the lambda expression.
     ParameterExpression paramExpr =
         Expressions.parameter(int.class, "key");
@@ -108,7 +111,7 @@
         s);
   }
 
-  public void testLambdaCallsTwoArgMethod() throws NoSuchMethodException {
+  @Test public void testLambdaCallsTwoArgMethod() throws NoSuchMethodException {
     // A parameter for the lambda expression.
     ParameterExpression paramS =
         Expressions.parameter(String.class, "s");
@@ -135,7 +138,7 @@
     assertEquals("lo w", s);
   }
 
-  public void testFoldAnd() {
+  @Test public void testFoldAnd() {
     // empty list yields true
     final List<Expression> list0 = Collections.emptyList();
     assertEquals(
@@ -194,7 +197,7 @@
             Expressions.foldOr(list3)));
   }
 
-  public void testWrite() {
+  @Test public void testWrite() {
     assertEquals(
         "1 + 2.0F + 3L + Long.valueOf(4L)",
         Expressions.toString(
@@ -371,7 +374,7 @@
                         String.class)))));
   }
 
-  public void testWriteConstant() {
+  @Test public void testWriteConstant() {
     // array of primitives
     assertEquals(
         "new int[] {\n"
@@ -507,7 +510,7 @@
             Expressions.constant(Linq4jTest.emps)));
   }
 
-  public void testWriteArray() {
+  @Test public void testWriteArray() {
     assertEquals(
         "1 + integers[2 + index]",
         Expressions.toString(
@@ -520,7 +523,7 @@
                         Expressions.variable(int.class, "index"))))));
   }
 
-  public void testWriteAnonymousClass() {
+  @Test public void testWriteAnonymousClass() {
     // final List<String> baz = Arrays.asList("foo", "bar");
     // new AbstractList<String>() {
     //     public int size() {
@@ -605,7 +608,7 @@
         Expressions.toString(e));
   }
 
-  public void testWriteWhile() {
+  @Test public void testWriteWhile() {
     DeclarationExpression xDecl, yDecl;
     Node node =
         Expressions.block(
@@ -634,7 +637,7 @@
         Expressions.toString(node));
   }
 
-  public void testType() {
+  @Test public void testType() {
     // Type of ternary operator is the gcd of its arguments.
     assertEquals(
         long.class,
@@ -664,7 +667,7 @@
             Expressions.constant(null)).getType());
   }
 
-  public void testCompile() throws NoSuchMethodException {
+  @Test public void testCompile() throws NoSuchMethodException {
     // Creating a parameter for the expression tree.
     ParameterExpression param = Expressions.parameter(String.class);
 
@@ -687,7 +690,7 @@
     assertEquals(1234, x);
   }
 
-  public void testBlockBuilder() {
+  @Test public void testBlockBuilder() {
     checkBlockBuilder(
         false,
         "{\n"
@@ -734,7 +737,7 @@
     assertEquals(expected, Expressions.toString(statements.toBlock()));
   }
 
-  public void testBlockBuilder2() {
+  @Test public void testBlockBuilder2() {
     BlockBuilder statements = new BlockBuilder();
     Expression element =
         statements.append(
@@ -764,7 +767,7 @@
         Expressions.toString(statements.toBlock()));
   }
 
-  public void testClassDecl() {
+  @Test public void testClassDecl() {
     final NewExpression newExpression =
         Expressions.new_(
             Object.class,
@@ -799,7 +802,7 @@
         Expressions.toString(newExpression));
   }
 
-  public void testReturn() {
+  @Test public void testReturn() {
     assertEquals(
         "if (true) {\n"
         + "  return;\n"
@@ -811,7 +814,7 @@
   }
 
   /** Test for common sub-expression elimination. */
-  public void testSubExpressionElimination() {
+  @Test public void testSubExpressionElimination() {
     final BlockBuilder builder = new BlockBuilder(true);
     ParameterExpression x = Expressions.parameter(Object.class, "p");
     Expression current4 = builder.append(
diff --git a/src/test/java/net/hydromatic/linq4j/test/Linq4jSuite.java b/src/test/java/net/hydromatic/linq4j/test/Linq4jSuite.java
index 0a96ee2..f3fedcd 100644
--- a/src/test/java/net/hydromatic/linq4j/test/Linq4jSuite.java
+++ b/src/test/java/net/hydromatic/linq4j/test/Linq4jSuite.java
@@ -19,21 +19,21 @@
 
 import net.hydromatic.linq4j.expressions.TypeTest;
 
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
 
 /**
  * Suite of all Linq4j tests.
  */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    PrimitiveTest.class,
+    Linq4jTest.class,
+    ExpressionTest.class,
+    TypeTest.class
+})
 public class Linq4jSuite {
-  /** Returns a {@link TestSuite junit suite} of all Linq4j tests. */
-  public static TestSuite suite() {
-    TestSuite testSuite = new TestSuite();
-    testSuite.addTestSuite(PrimitiveTest.class);
-    testSuite.addTestSuite(Linq4jTest.class);
-    testSuite.addTestSuite(ExpressionTest.class);
-    testSuite.addTestSuite(TypeTest.class);
-    return testSuite;
-  }
 }
 
 // End Linq4jSuite.java
diff --git a/src/test/java/net/hydromatic/linq4j/test/Linq4jTest.java b/src/test/java/net/hydromatic/linq4j/test/Linq4jTest.java
index 2a634ae..d7382df 100644
--- a/src/test/java/net/hydromatic/linq4j/test/Linq4jTest.java
+++ b/src/test/java/net/hydromatic/linq4j/test/Linq4jTest.java
@@ -21,15 +21,17 @@
 import net.hydromatic.linq4j.expressions.*;
 import net.hydromatic.linq4j.function.*;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 import java.util.*;
 
+import static org.junit.Assert.*;
+
+
 /**
  * Tests for LINQ4J.
  */
-public class Linq4jTest extends TestCase {
-
+public class Linq4jTest {
   public static final Function1<Employee, String> EMP_NAME_SELECTOR =
       new Function1<Employee, String>() {
         public String apply(Employee employee) {
@@ -94,7 +96,7 @@
         }
       };
 
-  public void testSelect() {
+  @Test public void testSelect() {
     List<String> names =
         Linq4j.asEnumerable(emps)
             .select(EMP_NAME_SELECTOR)
@@ -102,7 +104,7 @@
     assertEquals("[Fred, Bill, Eric, Janet]", names.toString());
   }
 
-  public void testWhere() {
+  @Test public void testWhere() {
     List<String> names =
         Linq4j.asEnumerable(emps)
             .where(
@@ -116,7 +118,7 @@
     assertEquals("[Fred, Eric, Janet]", names.toString());
   }
 
-  public void testWhereIndexed() {
+  @Test public void testWhereIndexed() {
     // Returns every other employee.
     List<String> names =
         Linq4j.asEnumerable(emps)
@@ -131,7 +133,7 @@
     assertEquals("[Fred, Eric]", names.toString());
   }
 
-  public void testSelectMany() {
+  @Test public void testSelectMany() {
     final List<String> nameSeqs =
         Linq4j.asEnumerable(depts)
             .selectMany(DEPT_EMPLOYEES_SELECTOR)
@@ -146,12 +148,12 @@
         "[#0: Fred, #1: Eric, #2: Janet, #3: Bill]", nameSeqs.toString());
   }
 
-  public void testCount() {
+  @Test public void testCount() {
     final int count = Linq4j.asEnumerable(depts).count();
     assertEquals(3, count);
   }
 
-  public void testCountPredicate() {
+  @Test public void testCountPredicate() {
     final int count =
         Linq4j.asEnumerable(depts).count(
             new Predicate1<Department>() {
@@ -162,12 +164,12 @@
     assertEquals(2, count);
   }
 
-  public void testLongCount() {
+  @Test public void testLongCount() {
     final long count = Linq4j.asEnumerable(depts).longCount();
     assertEquals(3, count);
   }
 
-  public void testLongCountPredicate() {
+  @Test public void testLongCountPredicate() {
     final long count =
         Linq4j.asEnumerable(depts).longCount(
             new Predicate1<Department>() {
@@ -178,51 +180,51 @@
     assertEquals(2, count);
   }
 
-  public void testAverageSelector() {
+  @Test public void testAverageSelector() {
     assertEquals(
         20,
         Linq4j.asEnumerable(depts).average(DEPT_DEPTNO_SELECTOR2));
   }
 
-  public void testMin() {
+  @Test public void testMin() {
     assertEquals(
         10,
         (int) Linq4j.asEnumerable(depts).select(DEPT_DEPTNO_SELECTOR)
             .min());
   }
 
-  public void testMinSelector() {
+  @Test public void testMinSelector() {
     assertEquals(
         10,
         (int) Linq4j.asEnumerable(depts).min(DEPT_DEPTNO_SELECTOR));
   }
 
-  public void testMinSelector2() {
+  @Test public void testMinSelector2() {
     assertEquals(
         10,
         Linq4j.asEnumerable(depts).min(DEPT_DEPTNO_SELECTOR2));
   }
 
-  public void testMax() {
+  @Test public void testMax() {
     assertEquals(
         30,
         (int) Linq4j.asEnumerable(depts).select(DEPT_DEPTNO_SELECTOR)
             .max());
   }
 
-  public void testMaxSelector() {
+  @Test public void testMaxSelector() {
     assertEquals(
         30,
         (int) Linq4j.asEnumerable(depts).max(DEPT_DEPTNO_SELECTOR));
   }
 
-  public void testMaxSelector2() {
+  @Test public void testMaxSelector2() {
     assertEquals(
         30,
         Linq4j.asEnumerable(depts).max(DEPT_DEPTNO_SELECTOR2));
   }
 
-  public void testAggregate() {
+  @Test public void testAggregate() {
     assertEquals(
         "Sales,HR,Marketing",
         Linq4j.asEnumerable(depts)
@@ -236,7 +238,7 @@
                 }));
   }
 
-  public void testToMap() {
+  @Test public void testToMap() {
     final Map<Integer, Employee> map =
         Linq4j.asEnumerable(emps)
             .toMap(EMP_EMPNO_SELECTOR);
@@ -244,7 +246,7 @@
     assertTrue(map.get(110).name.equals("Bill"));
   }
 
-  public void testToMap2() {
+  @Test public void testToMap2() {
     final Map<Integer, Integer> map =
         Linq4j.asEnumerable(emps)
             .toMap(EMP_EMPNO_SELECTOR, EMP_DEPTNO_SELECTOR);
@@ -252,7 +254,7 @@
     assertTrue(map.get(110) == 30);
   }
 
-  public void testToLookup() {
+  @Test public void testToLookup() {
     final Lookup<Integer, Employee> lookup =
         Linq4j.asEnumerable(emps).toLookup(
             EMP_DEPTNO_SELECTOR);
@@ -273,7 +275,7 @@
     assertEquals(n, 2);
   }
 
-  public void testToLookupSelector() {
+  @Test public void testToLookupSelector() {
     final Lookup<Integer, String> lookup =
         Linq4j.asEnumerable(emps).toLookup(
             EMP_DEPTNO_SELECTOR,
@@ -312,7 +314,7 @@
             .toList().toString());
   }
 
-  public void testToLookupSelectorComparer() {
+  @Test public void testToLookupSelectorComparer() {
     final Lookup<String, Employee> lookup =
         Linq4j.asEnumerable(emps).toLookup(
             EMP_NAME_SELECTOR,
@@ -354,7 +356,7 @@
    * Tests the version of {@link ExtendedEnumerable#groupBy}
    * that uses an accumulator; does not build intermediate lists.
    */
-  public void testGroupBy() {
+  @Test public void testGroupBy() {
     String s =
         Linq4j.asEnumerable(emps)
             .groupBy(
@@ -386,7 +388,7 @@
    * that has a result selector. Note how similar it is to
    * {@link #testGroupBy()}.
    */
-  public void testAggregate2() {
+  @Test public void testAggregate2() {
     String s =
         Linq4j.asEnumerable(emps)
             .aggregate(
@@ -411,7 +413,7 @@
         s);
   }
 
-  public void testCast() {
+  @Test public void testCast() {
     final List<Number> numbers = Arrays.asList((Number) 2, null, 3.14, 5);
     final Enumerator<Integer> enumerator =
         Linq4j.asEnumerable(numbers)
@@ -420,7 +422,7 @@
     checkCast(enumerator);
   }
 
-  public void testIterableCast() {
+  @Test public void testIterableCast() {
     final List<Number> numbers = Arrays.asList((Number) 2, null, 3.14, 5);
     final Enumerator<Integer> enumerator =
         Linq4j.cast(numbers, Integer.class)
@@ -448,7 +450,7 @@
     assertEquals(Integer.valueOf(2), enumerator.current());
   }
 
-  public void testOfType() {
+  @Test public void testOfType() {
     final List<Number> numbers = Arrays.asList((Number) 2, null, 3.14, 5);
     final Enumerator<Integer> enumerator =
         Linq4j.asEnumerable(numbers)
@@ -457,7 +459,7 @@
     checkIterable(enumerator);
   }
 
-  public void testIterableOfType() {
+  @Test public void testIterableOfType() {
     final List<Number> numbers = Arrays.asList((Number) 2, null, 3.14, 5);
     final Enumerator<Integer> enumerator =
         Linq4j.ofType(numbers, Integer.class)
@@ -478,7 +480,7 @@
     assertEquals(Integer.valueOf(2), enumerator.current());
   }
 
-  public void testConcat() {
+  @Test public void testConcat() {
     assertEquals(
         5,
         Linq4j.asEnumerable(emps)
@@ -486,7 +488,7 @@
             .count());
   }
 
-  public void testUnion() {
+  @Test public void testUnion() {
     assertEquals(
         5,
         Linq4j.asEnumerable(emps)
@@ -495,7 +497,7 @@
             .count());
   }
 
-  public void testIntersect() {
+  @Test public void testIntersect() {
     final Employee[] emps2 = {
         new Employee(150, "Theodore", 10),
         emps[3],
@@ -507,7 +509,7 @@
             .count());
   }
 
-  public void testExcept() {
+  @Test public void testExcept() {
     final Employee[] emps2 = {
         new Employee(150, "Theodore", 10),
         emps[3],
@@ -519,7 +521,7 @@
             .count());
   }
 
-  public void testGroupJoin() {
+  @Test public void testGroupJoin() {
     // Note #1: Group join is a "left join": "bad employees" are filtered
     //   out, but empty departments are not.
     // Note #2: Order of departments is preserved.
@@ -553,7 +555,7 @@
         s);
   }
 
-  public void testJoin() {
+  @Test public void testJoin() {
     // Note #1: Inner on both sides. Employees with bad departments,
     //   and departments with no employees are eliminated.
     // Note #2: Order of employees is preserved.
@@ -580,7 +582,7 @@
         s);
   }
 
-  public void testJoinCartesianProduct() {
+  @Test public void testJoinCartesianProduct() {
     int n =
         Linq4j.asEnumerable(emps)
             .<Department, Integer, Integer>join(
@@ -593,7 +595,7 @@
   }
 
   @SuppressWarnings("unchecked")
-  public void testCartesianProductEnumerator() {
+  @Test public void testCartesianProductEnumerator() {
     final Enumerable<String> abc =
         Linq4j.asEnumerable(Arrays.asList("a", "b", "c"));
     final Enumerable<String> xy =
@@ -631,7 +633,7 @@
     assertFalse(productAbcXy.moveNext());
   }
 
-  public void testAsQueryable() {
+  @Test public void testAsQueryable() {
     // "count" is an Enumerable method.
     final int n =
         Linq4j.asEnumerable(emps)
@@ -698,7 +700,7 @@
     assertEquals(2, nh3.count());
   }
 
-  public void testTake() {
+  @Test public void testTake() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> enumerableDeptsResult =
@@ -712,7 +714,7 @@
     assertEquals(3, enumerableDeptsResult5.size());
   }
 
-  public void testTake_enumerable() {
+  @Test public void testTake_enumerable() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> enumerableDeptsResult =
@@ -726,7 +728,7 @@
     assertEquals(3, enumerableDeptsResult5.size());
   }
 
-  public void testTake_queryable() {
+  @Test public void testTake_queryable() {
     final Queryable<Department> querableDepts =
         Linq4j.asEnumerable(depts).asQueryable();
     final List<Department> queryableResult =
@@ -737,7 +739,7 @@
     assertEquals(depts[1], queryableResult.get(1));
   }
 
-  public void testTake_enumerable_zero_or_negative_size() {
+  @Test public void testTake_enumerable_zero_or_negative_size() {
     assertEquals(
         0,
         EnumerableDefaults.take(Linq4j.asEnumerable(depts), 0)
@@ -748,7 +750,7 @@
             .toList().size());
   }
 
-  public void testTake_queryable_zero_or_negative_size() {
+  @Test public void testTake_queryable_zero_or_negative_size() {
     assertEquals(
         0,
         QueryableDefaults.take(Linq4j.asEnumerable(depts).asQueryable(), 0)
@@ -759,7 +761,7 @@
             .toList().size());
   }
 
-  public void testTake_enumerable_greater_than_length() {
+  @Test public void testTake_enumerable_greater_than_length() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> depList =
@@ -770,7 +772,7 @@
     assertEquals(depts[2], depList.get(2));
   }
 
-  public void testTake_queryable_greater_than_length() {
+  @Test public void testTake_queryable_greater_than_length() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> depList =
@@ -781,7 +783,7 @@
     assertEquals(depts[2], depList.get(2));
   }
 
-  public void testTakeWhile_enumerable_predicate() {
+  @Test public void testTakeWhile_enumerable_predicate() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> deptList =
@@ -800,7 +802,7 @@
     assertEquals(depts[0], deptList.get(0));
   }
 
-  public void testTakeWhile_enumerable_function() {
+  @Test public void testTakeWhile_enumerable_function() {
     final Enumerable<Department> enumerableDepts =
         Linq4j.asEnumerable(depts);
     final List<Department> deptList =
@@ -820,7 +822,7 @@
     assertEquals(depts[0], deptList.get(0));
   }
 
-  public void testTakeWhile_queryable_functionexpression_predicate() {
+  @Test public void testTakeWhile_queryable_functionexpression_predicate() {
     final Queryable<Department> queryableDepts =
         Linq4j.asEnumerable(depts).asQueryable();
     Predicate1<Department> predicate = new Predicate1<Department>() {
@@ -849,7 +851,7 @@
     assertEquals(depts[0], deptList.get(0));
   }
 
-  public void testTakeWhileN() {
+  @Test public void testTakeWhileN() {
     final Queryable<Department> queryableDepts =
         Linq4j.asEnumerable(depts).asQueryable();
     Predicate2<Department, Integer> function2 =
@@ -873,7 +875,7 @@
     assertEquals(depts[1], deptList.get(1));
   }
 
-  public void testTakeWhileN_no_match() {
+  @Test public void testTakeWhileN_no_match() {
     final Queryable<Department> queryableDepts =
         Linq4j.asEnumerable(depts).asQueryable();
     Predicate2<Department, Integer> function2 = Functions.falsePredicate2();
@@ -886,7 +888,7 @@
     assertEquals(0, deptList.size());
   }
 
-  public void testSkip() {
+  @Test public void testSkip() {
     assertEquals(2, Linq4j.asEnumerable(depts).skip(1).count());
     assertEquals(
         2,
@@ -943,7 +945,7 @@
                 })).count());
   }
 
-  public void testOrderBy() {
+  @Test public void testOrderBy() {
     // Note: sort is stable. Records occur Fred, Eric, Janet in input.
     assertEquals(
         "[Employee(name: Fred, deptno:10),"
@@ -954,7 +956,7 @@
             .toList().toString());
   }
 
-  public void testOrderByComparator() {
+  @Test public void testOrderByComparator() {
     assertEquals(
         "[Employee(name: Bill, deptno:30),"
         + " Employee(name: Eric, deptno:10),"
@@ -967,7 +969,7 @@
             .toList().toString());
   }
 
-  public void testOrderByInSeries() {
+  @Test public void testOrderByInSeries() {
     // OrderBy in series works because sort is stable.
     assertEquals(
         "[Employee(name: Eric, deptno:10),"
@@ -980,7 +982,7 @@
             .toList().toString());
   }
 
-  public void testOrderByDescending() {
+  @Test public void testOrderByDescending() {
     assertEquals(
         "[Employee(name: Janet, deptno:10),"
         + " Employee(name: Fred, deptno:10),"
@@ -991,7 +993,7 @@
             .toList().toString());
   }
 
-  public void testReverse() {
+  @Test public void testReverse() {
     assertEquals(
         "[Employee(name: Janet, deptno:10),"
         + " Employee(name: Eric, deptno:10),"
@@ -1003,7 +1005,7 @@
             .toString());
   }
 
-  public void testList0() {
+  @Test public void testList0() {
     final List<Employee> employees = Arrays.asList(
         new Employee(100, "Fred", 10),
         new Employee(110, "Bill", 30),
@@ -1023,7 +1025,7 @@
         result.toString());
   }
 
-  public void testList() {
+  @Test public void testList() {
     final List<Employee> employees = Arrays.asList(
         new Employee(100, "Fred", 10),
         new Employee(110, "Bill", 30),
diff --git a/src/test/java/net/hydromatic/linq4j/test/PrimitiveTest.java b/src/test/java/net/hydromatic/linq4j/test/PrimitiveTest.java
index d0b67b8..5ebd501 100644
--- a/src/test/java/net/hydromatic/linq4j/test/PrimitiveTest.java
+++ b/src/test/java/net/hydromatic/linq4j/test/PrimitiveTest.java
@@ -19,17 +19,19 @@
 
 import net.hydromatic.linq4j.expressions.Primitive;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.junit.Assert.*;
+
 
 /**
  * Unit test for {@link Primitive}.
  */
-public class PrimitiveTest extends TestCase {
-  public void testIsAssignableFrom() {
+public class PrimitiveTest {
+  @Test public void testIsAssignableFrom() {
     assertTrue(Primitive.INT.assignableFrom(Primitive.BYTE));
     assertTrue(Primitive.INT.assignableFrom(Primitive.SHORT));
     assertTrue(Primitive.INT.assignableFrom(Primitive.CHAR));
@@ -63,21 +65,21 @@
     assertFalse(Primitive.INT.assignableFrom(Primitive.BOOLEAN));
   }
 
-  public void testBox() {
+  @Test public void testBox() {
     assertEquals(String.class, Primitive.box(String.class));
     assertEquals(Integer.class, Primitive.box(int.class));
     assertEquals(Integer.class, Primitive.box(Integer.class));
     assertEquals(boolean[].class, Primitive.box(boolean[].class));
   }
 
-  public void testOfBox() {
+  @Test public void testOfBox() {
     assertEquals(Primitive.INT, Primitive.ofBox(Integer.class));
     assertNull(Primitive.ofBox(int.class));
     assertNull(Primitive.ofBox(String.class));
     assertNull(Primitive.ofBox(Integer[].class));
   }
 
-  public void testOfBoxOr() {
+  @Test public void testOfBoxOr() {
     assertEquals(Primitive.INT, Primitive.ofBox(Integer.class));
     assertNull(Primitive.ofBox(int.class));
     assertNull(Primitive.ofBox(String.class));
@@ -85,14 +87,14 @@
   }
 
   /** Tests the {@link Primitive#number(Number)} method. */
-  public void testNumber() {
+  @Test public void testNumber() {
     Number number = Primitive.SHORT.number(Integer.valueOf(2));
     assertTrue(number instanceof Short);
     assertEquals(2, number.shortValue());
 
     number = Primitive.FLOAT.number(Integer.valueOf(2));
     assertTrue(number instanceof Float);
-    assertEquals(2.0d, number.doubleValue());
+    assertEquals(2.0d, number.doubleValue(), 0d);
 
     try {
       number = Primitive.INT.number(null);
@@ -119,7 +121,7 @@
   }
 
   /** Test for {@link Primitive#send(net.hydromatic.linq4j.expressions.Primitive.Source, net.hydromatic.linq4j.expressions.Primitive.Sink)}. */
-  public void testSendSource() {
+  @Test public void testSendSource() {
     final List<Object> list = new ArrayList<Object>();
     for (Primitive primitive : Primitive.values()) {
       primitive.send(
@@ -231,7 +233,7 @@
   }
 
   /** Test for {@link Primitive#permute(Object, int[])}. */
-  public void testPermute() {
+  @Test public void testPermute() {
     char[] chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g'};
     int[] sources = {1, 2, 3, 4, 5, 6, 0};
     final Object permute = Primitive.CHAR.permute(chars, sources);