handle count/offset < 1 in java methods