interface Task{}
interface Comment{}
class TaskImpl implements Task{}
class CommentImpl extends TaskImpl implements Task, Comment {}
class Service {
Task newTask {return new TaskImpl();}
Comment newComment(long taskId){return new CommentImpl(taskId);}
<T extends Z&X> commentAsTask(long taskId){return new CommentImpl(taskId);}
}