test classes and fix for #615, inferring return type if not specified in annotations