Here you go.
for (IOrder orderInMarket : engine.getOrders()) {
if (order.getFillTime() + millisec < tick.getTime()) {
order.close();
}
}
Think I found the mistake in yours though:
In the second-last line your code says
if (order.getCreationTime() <= expirationTime) {
Upon creation the creation time will be less than the expiration time. Had the exact same problem with mine, which i posted above... took me hours. :/