would it work on both JVMs if we passed in the spec itself and just used `spec.getClass`?