@Override public boolean equals(Object obj) { if (!(obj instanceof BoxProvider)) return false; final BoxProvider other = (BoxProvider) obj; BoxProviderResult resultOther = other.get(); if (resultOther.isTemporary()) return false; return box.equals(resultOther.getBox()); }
public Rectangle getBox() { if (boxProvider != null) { BoxProviderResult result = boxProvider.get(); if (!result.isTemporary()) { box = result.getBox(); boxProvider = null; } return result.getBox(); } return box; }