MfClassicNdefOperations extends AbstractNdefOperations { @Override public void makeReadOnly() { assertFormatted(); assertWritable(); try { Application application = getApplication(); application.getApplicationDirectory().makeReadOnly(); application.makeReadOnly(new KeyValue(Key.B, writeKey)); writable = false; } catch (IOException e) { throw new NfcException(e); } } MfClassicNdefOperations(MfClassicReaderWriter readerWriter, TagInfo tagInfo, boolean formatted,
			boolean writeable); @Override int getMaxSize(); @Override List<Record> readNdefMessage(); @Override void writeNdefMessage(Record... records); @Override void makeReadOnly(); @Override void format(Record... records);  }
@Test public void testMakeReadOnly() throws Exception { for (Config config : MAKE_READ_ONLY_TEST) { init(config); assertTrue(ndefOperations.isWritable()); ndefOperations.makeReadOnly(); assertFalse(ndefOperations.isWritable()); assertArrayEquals(expectedTag.getMemoryMap().getMemory(), tag.getMemoryMap().getMemory()); } }