Add extract method and method object example code.