@SuppressWarnings("unchecked") @Override public List<Version> getVersions() { if (versions == null) { int count = 1; if (revisions != null) { count = count + revisions.size(); } ArrayList<Version> list = new ArrayList<>(count); if (getTime() != Long.MIN_VALUE) { list.add(new Version(this)); } if (revisions != null) { for (LongRevision lr : revisions) { if (lr.getTime() != Long.MIN_VALUE) { list.add(new Version(lr)); } } } versions = list; } return (List<Version>) versions; }
private LongMember makeTestObject2() { // Create an object to test... LongMember obj = new LongMember(); obj.setLongValue((long) 1); obj.setStatusAtPositionNid(2); obj.nid = 2; obj.primordialSapNid = 2; obj.primordialUNid = 2; obj.revisions = new CopyOnWriteArrayList<LongRevision>(); LongRevision rev = new LongRevision(); rev.primordialComponent = obj; rev.sapNid = 2; rev.setLongValue((long) 1); rev.setStatusAtPositionNid(2); obj.revisions.add(rev); return obj; }