class Exif {

    public void save() throws IOException {
        if (!mRemoveTimestamp) {
            attachLastModifiedTimestamp();
        }
        mExifInterface.saveAttributes();
    }

}

class ExifTest {

     Exif exif;

    @Test
    public void save() {

        assertEquals(-1, exif.getLastModifiedTimestamp());

        try {
            exif.save();
        } catch (IOException e) {
            // expected
        }

        assertWithin(System.currentTimeMillis(), exif.getLastModifiedTimestamp(), 3);

        // removeTimestamp should also be clearing the last modified timestamp
        exif.removeTimestamp();
        assertEquals(-1, exif.getLastModifiedTimestamp());

        // Even when saving again
        try {
            exif.save();
        } catch (IOException e) {
            // expected
        }

        assertEquals(-1, exif.getLastModifiedTimestamp());
    }

}