I know you might have seen somewhere in our code base but this is not ideal you need to check if ot.equals(orderType) which uses uuid, The existing checks are getting fixed by https://tickets.openmrs.org/browse/TRUNK-4095