AbstractResumeBreakPointManager implements ResumeBreakPointManager, Closeable { protected final void resumeInventoryPosition(final String data) { if (Strings.isNullOrEmpty(data)) { return; } log.info("resume inventory position from {} = {}", taskPath, data); InventoryPositions inventoryPositions = InventoryPositions.fromJson(data); Map<String, InventoryPosition> unfinished = inventoryPositions.getUnfinished(); for (Entry<String, InventoryPosition> entry : unfinished.entrySet()) { inventoryPositionManagerMap.put(entry.getKey(), new InventoryPositionManager<>(entry.getValue())); } for (String each : inventoryPositions.getFinished()) { inventoryPositionManagerMap.put(each, new InventoryPositionManager<>(new FinishedInventoryPosition())); } }  @Override void close();  }
@Test public void assertResumeIncrementalPosition() { resumeBreakPointManager.resumeInventoryPosition(""); assertThat(resumeBreakPointManager.getInventoryPositionManagerMap().size(), is(0)); resumeBreakPointManager.resumeInventoryPosition(inventoryPosition); assertThat(resumeBreakPointManager.getInventoryPositionManagerMap().size(), is(4)); }