timeout() should take a long as a parameter.
Generally libraries handle timeout milliseconds as longs for example TimeUnit.SECONDS.toMillis(1) returns a longs as well. I have to cast this value down to int every time I plan to use TimeUnit.