Add fully working test implementation of #1