[java] One liner to check if element is in the list