### Question:
ExactlyOnceCloseable implements AutoCloseable { @Override public void close() { try { UPDATER.getAndUpdate(this, c -> () -> { }).close(); } catch (Exception ignore) { Logger.getLogger(ExactlyOnceCloseable.class.getName()).log( Level.FINER, ignore.getMessage(), ignore); } } ExactlyOnceCloseable(AutoCloseable closeable); static ExactlyOnceCloseable wrap(AutoCloseable c); @Override void close();  }### Answer:
@Test public void close() { int[] counter = { 0 }; ExactlyOnceCloseable c = ExactlyOnceCloseable.wrap(() -> counter[0]++); c.close(); c.close(); assertEquals(1, counter[0]); }