Q:

Creating common method for two classes not using inheritance in java

I'm just wondering if there is any way to create two classes that aren't related but have the same implementation of method. I know there are interfaces and static methods but it seems like they are good only when you have static field in class. Is this possible to do that kind of thing when method uses field that is specific to exact object? 
I know it's a bad practice writing code like this but I'm just curious. 
EDIT:
I mean something like this:
public class Person implements MakingOlder {
  private int age;
}

public class Cat implements MakingOlder {
  private int age;
}

public interface MakingOlder {
  public static void makeOlder() {
        this.age += 2;
  }
}

I don't want to make common base class for Person and Cat and interface is not working. I'm trying to avoid writing the same implementation twice and copying the code.

A:

Sure, it's called "composition + delegation", and it's often a good practice to replace inheritance by this :
https://en.wikipedia.org/wiki/Composition_over_inheritance
public class Person implements AgingObject {
  private int age;  
  private AgingBehavior agingBehavior;

  void makeOlder() {
    agingBehavior.makeOlder(this);
  }
  //(...)
}

public class Cat implements AgingObject {
  private int age;
  private AgingBehavior agingBehavior;

  void makeOlder() {
    agingBehavior.makeOlder(this);
  }
  //(...)
}

public class AgingBehavior {
  void makeOlder(AgingObject agingObject) {
    agingObject.setAge(agingObject.getAge() + 2);
  }
}

public interface AgingObject {
    int getAge();
    void setAge(int age);
}

