refs #9955. Add test and introduce replace functionality.