Isn't that the point of timed tests? You can structure a test such that the person who needs to look up how to add two ints in Java will waste so much time that they wouldn't be able to finish the test. And if they can search for and apply this knowledge quickly enough, then maybe they've proven that they won't be slow if they have to do it in the real world.
My favourite exams were open book but still hard/long enough that if you didn't already know 95% of the material, you simply wouldn't have time to complete it.