org.mutabilitydetector.benchmarks.Fakeout Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of MutabilityDetector Show documentation
Show all versions of MutabilityDetector Show documentation
Lightweight analysis tool for detecting mutability in Java
classes.
package org.mutabilitydetector.benchmarks;
import java.util.IdentityHashMap;
import java.util.Map;
/**
* Benchmark discussed on the project lombok mailing list, here
*
*/
public final class Fakeout {
private static final Map map = new IdentityHashMap();
public Fakeout() {
map.put(this, 0);
}
public void setAge(int age) {
map.put(this, age);
}
public int getAge() {
return map.get(this);
}
}