mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 19:21:16 +07:00
25 lines
459 B
Java
25 lines
459 B
Java
public class Foo {
|
|
|
|
private int counter;
|
|
|
|
public Foo(int initialCounter) {
|
|
this.counter = initialCounter;
|
|
}
|
|
|
|
static void toBeRefactored(final Foo anObject) {
|
|
new Foo(anObject.counter + 10) {
|
|
void toImplement() {
|
|
toCall();
|
|
}
|
|
}.toImplement();
|
|
}
|
|
|
|
void toCall() {
|
|
System.out.println("Counter: " + counter);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
Foo foo = new Foo(5);
|
|
Foo.toBeRefactored(foo);
|
|
}
|
|
} |