Ported some java expected conditions