coverage, refactor nil_if_empty for ruby2 arrays