return a.contains(b); ? 
Otherwise you may want to use a.DOCUMENT_POSITION_CONTAINS instead of harcoding 16.