adjusted version, enhanced testcase using companion objects