I need a method that expects different parameters, and behave differently depending on the parameters, like in this example:

```
public void doSomething(A a, B b, C c) {
    doSomeGeneralStuff();

    if a.isPresent() {
        doSomethingWithA();
    }
    if b.isPresent() {
        doSomethingWithB();
    }
    if c.isPresent() {
        doSomethingWithC();
    }
}

```

An alternative would be this:

```
public void doSomething(A a) {
    doSomeGeneralStuff();
    doSomethingWithA();
}
public void doSomething(B b) {
    doSomeGeneralStuff();
    doSomethingWithB();
}
public void doSomething(C c) {
    doSomeGeneralStuff();
    doSomethingWithC();
}

```

But I would have a bunch of redundant code in the second example, that's why I'm still not satisfied. What other patterns deal with this problem?