/** * Get guid in this state if available. This is the reverse operation of {@link #setWorkUnitGuid}. * @param state State from which guid should be extracted. * @return A byte array guid. * @throws IOException */ public static Optional<Guid> getWorkUnitGuid(State state) throws IOException { if (state.contains(WORK_UNIT_GUID)) { return Optional.of(Guid.deserialize(state.getProp(WORK_UNIT_GUID))); } return Optional.absent(); }