@Test public void testProcessWithNullEntry() throws Exception { Map.Entry<Object, Expirable> entry = mockEntry(null); LockEntryProcessor processor = new LockEntryProcessor("next-marker-id", 100L, null); ArgumentCaptor<Expirable> captor = ArgumentCaptor.forClass(Expirable.class); processor.process(entry); verify(entry).setValue(captor.capture()); Expirable result = captor.getValue(); assertThat(result, instanceOf(ExpiryMarker.class)); ExpiryMarker marker = (ExpiryMarker) result; assertTrue(marker.matches(new ExpiryMarker(null, 0L, "next-marker-id"))); }
@Override public Expirable process(final Map.Entry<Object, Expirable> entry) { Expirable expirable = entry.getValue(); if (expirable == null) { expirable = new ExpiryMarker(version, timeout, nextMarkerId); } else { expirable = expirable.markForExpiration(timeout, nextMarkerId); } entry.setValue(expirable); return expirable; }
LockEntryProcessor implements EntryProcessor<Object, Expirable, Expirable>, IdentifiedDataSerializable { @Override public Expirable process(final Map.Entry<Object, Expirable> entry) { Expirable expirable = entry.getValue(); if (expirable == null) { expirable = new ExpiryMarker(version, timeout, nextMarkerId); } else { expirable = expirable.markForExpiration(timeout, nextMarkerId); } entry.setValue(expirable); return expirable; } }
LockEntryProcessor implements EntryProcessor<Object, Expirable, Expirable>, IdentifiedDataSerializable { @Override public Expirable process(final Map.Entry<Object, Expirable> entry) { Expirable expirable = entry.getValue(); if (expirable == null) { expirable = new ExpiryMarker(version, timeout, nextMarkerId); } else { expirable = expirable.markForExpiration(timeout, nextMarkerId); } entry.setValue(expirable); return expirable; } LockEntryProcessor();  LockEntryProcessor(final String nextMarkerId, final long timeout, final Object version); }
LockEntryProcessor implements EntryProcessor<Object, Expirable, Expirable>, IdentifiedDataSerializable { @Override public Expirable process(final Map.Entry<Object, Expirable> entry) { Expirable expirable = entry.getValue(); if (expirable == null) { expirable = new ExpiryMarker(version, timeout, nextMarkerId); } else { expirable = expirable.markForExpiration(timeout, nextMarkerId); } entry.setValue(expirable); return expirable; } LockEntryProcessor();  LockEntryProcessor(final String nextMarkerId, final long timeout, final Object version); @Override Expirable process(final Map.Entry<Object, Expirable> entry); @Override void writeData(final ObjectDataOutput out); @Override void readData(final ObjectDataInput in); @Override int getFactoryId(); @Override int getClassId(); }
LockEntryProcessor implements EntryProcessor<Object, Expirable, Expirable>, IdentifiedDataSerializable { @Override public Expirable process(final Map.Entry<Object, Expirable> entry) { Expirable expirable = entry.getValue(); if (expirable == null) { expirable = new ExpiryMarker(version, timeout, nextMarkerId); } else { expirable = expirable.markForExpiration(timeout, nextMarkerId); } entry.setValue(expirable); return expirable; } LockEntryProcessor();  LockEntryProcessor(final String nextMarkerId, final long timeout, final Object version); @Override Expirable process(final Map.Entry<Object, Expirable> entry); @Override void writeData(final ObjectDataOutput out); @Override void readData(final ObjectDataInput in); @Override int getFactoryId(); @Override int getClassId();  }