for (Object object : myList)
{
if (object instanceof ReadNextMessage)
{
ReadNextMessage readNextMessage = (ReadNextMessage) object;
invocation = (Element) readNextMessage.getAny();
}
else if (object instanceof DeleteNextUnitOfWork)
{
DeleteNextUnitOfWork deleteNextUnitOfWork = (DeleteNextUnitOfWork) object;
invocation = (Element) deleteNextUnitOfWork.getAny();