safeHeadとsafeLastを追加．
Merge pull request #1 from y-tsutsu/master

test