Description
I'm writing code to clone a PDPage as a deep copy. I'm trying to decide which objects are mutable and which are immutable.
COSInteger is confusing. It has a factory method, which suggests there is some internal caching going on, but it also has a setValue() method. Caching makes sense for immutable objects. If it is caching values, then setValue() should probably be deprecated or removed.
- * *
Proposed JUnit code:
COSInteger original = COSInteger.get(1);
COSInteger copy = COSInteger.get(1);
copy.setValue(5);
assertEquals(1L, original.longValue());