Stable under specialization sets and cofiniteness