### Question:
AndroidNfcReader extends AbstractSelectionLocalReader implements NfcAdapter.ReaderCallback { @Override public void setParameter(String key, String value) throws IllegalArgumentException { LOG.info("AndroidNfcReader supports the following parameters"); LOG.info(READER_NAME, "FLAG_READER_SKIP_NDEF_CHECK:\"int\", FLAG_READER_NO_PLATFORM_SOUNDS:\"int\", FLAG_READER_PRESENCE_CHECK_DELAY:\"int\""); Boolean correctParameter = (key.equals(AndroidNfcReader.FLAG_READER_SKIP_NDEF_CHECK) && value.equals("1") || value.equals("0")) || (key.equals(AndroidNfcReader.FLAG_READER_NO_PLATFORM_SOUNDS) && value.equals("1") || value.equals("0")) || (key.equals(AndroidNfcReader.FLAG_READER_PRESENCE_CHECK_DELAY) && Integer.parseInt(value) > -1); if (correctParameter) { LOG.warn("Adding parameter : " + key + " - " + value); parameters.put(key, value); } else { LOG.warn("Unrecognized parameter : " + key); throw new IllegalArgumentException("Unrecognized parameter " + key + " : " + value); } } AndroidNfcReader(); Map<String, String> getParameters(); @Override void setParameter(String key, String value); @Override TransmissionMode getTransmissionMode(); @Override void onTagDiscovered(Tag tag); String printTagId(); static final String FLAG_READER_SKIP_NDEF_CHECK; static final String FLAG_READER_NO_PLATFORM_SOUNDS; static final String FLAG_READER_PRESENCE_CHECK_DELAY; }### Answer:
@Test(expected = IllegalArgumentException.class) public void setUnknownParameter() throws IllegalArgumentException { reader.setParameter("dsfsdf", "sdfdsf"); }
@Test(expected = IllegalArgumentException.class) public void setUnCorrectParameter() throws IllegalArgumentException { reader.setParameter(AndroidNfcReader.FLAG_READER_NO_PLATFORM_SOUNDS, "A"); }
@Test(expected = IllegalArgumentException.class) public void setUnCorrectParameter2() throws IllegalArgumentException { reader.setParameter(AndroidNfcReader.FLAG_READER_SKIP_NDEF_CHECK, "2"); }
@Test(expected = IllegalArgumentException.class) public void setUnCorrectParameter3() throws IllegalArgumentException { reader.setParameter(AndroidNfcReader.FLAG_READER_PRESENCE_CHECK_DELAY, "-1"); }