fixed an unsafe type conversion with mockito. fixes #260