void (boolean ignoreCloseProblem) { for (PersistentObject object : myObjects) { try { object.close(); } catch (Throwable throwable) { if (!ignoreCloseProblem) throw new RuntimeException(throwable); } } }