SendDynamicServerCertificateAction extends MessageAction implements SendingAction { @Override public void reset() { List<ModifiableVariableHolder> holders = new LinkedList<>(); if (messages != null) { for (ProtocolMessage message : messages) { holders.addAll(message.getAllModifiableVariableHolders()); } } if (getRecords() != null) { for (AbstractRecord record : getRecords()) { holders.addAll(record.getAllModifiableVariableHolders()); } } for (ModifiableVariableHolder holder : holders) { List<Field> fields = holder.getAllModifiableVariableFields(); for (Field f : fields) { f.setAccessible(true); ModifiableVariable mv = null; try { mv = (ModifiableVariable) f.get(holder); } catch (IllegalArgumentException | IllegalAccessException ex) { LOGGER.warn("Could not retrieve ModifiableVariables"); LOGGER.debug(ex); } if (mv != null) { if (mv.getModification() != null || mv.isCreateRandomModification()) { mv.setOriginalValue(null); } else { try { f.set(holder, null); } catch (IllegalArgumentException | IllegalAccessException ex) { LOGGER.warn("Could not strip ModifiableVariable without Modification"); } } } } } setExecuted(null); } SendDynamicServerCertificateAction();  SendDynamicServerCertificateAction(String connectionAlias); @Override void execute(State state); @Override String toString(); @Override String toCompactString(); @Override boolean executedAsPlanned(); @Override void setRecords(List<AbstractRecord> records); @Override void reset(); @Override List<ProtocolMessage> getSendMessages(); @Override List<AbstractRecord> getSendRecords(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testReset() { assertFalse(action.isExecuted()); action.execute(state); assertTrue(action.isExecuted()); action.reset(); assertFalse(action.isExecuted()); action.execute(state); assertTrue(action.isExecuted()); }