### Question:
FedoraProducer extends DefaultProducer { protected String getParam(String param) { if (hasParam(param)) { return param; } else { return null; } } FedoraProducer(Endpoint endpoint);   }### Answer:
@Test public void testGetParam() { System.out.println("Testing getParam(String)"); String expected = "validParam"; String actual = this.producer.getParam(expected); assertEquals("Parameter should have been returned", expected, actual); assertNull("Results should have been null", this.producer.getParam(null)); assertNull("Results should have been null", this.producer.getParam("")); assertNull("Results should have been null", this.producer.getParam("null")); }
@Test public void testGetParamOrHeaderValue() { System.out.println("Testing getParam(String, String)"); String expected = "valid"; assertEquals("Parameter should have been returned", expected, this.producer.getParam(expected, "invalid")); assertEquals("Parameter should have been returned", expected, this.producer.getParam(expected, null)); assertEquals("Header should have been returned", expected, this.producer.getParam(null, expected)); assertEquals("Header should have been returned", expected, this.producer.getParam("", expected)); assertNull("Null should have been returned", this.producer.getParam("null", expected)); assertNull("Null should have been returned", this.producer.getParam(null, null)); assertNull("Null should have been returned", this.producer.getParam("", null)); }