You probably want to use ExpressionParser.getEmbeddedValues because it handles Lists and DBRefs correctly.