### Question:
JMSMessagePropertySupport { @SuppressWarnings("unchecked") public static <T> T convertPropertyTo(String name, Object value, Class<T> target) throws JMSException { if (value == null) { if (Boolean.class.equals(target)) { return (T) Boolean.FALSE; } else if (Float.class.equals(target) || Double.class.equals(target)) { throw new NullPointerException("property " + name + " was null"); } else if (Number.class.isAssignableFrom(target)) { throw new NumberFormatException("property " + name + " was null"); } else { return null; } } T rc = (T) TypeConversionSupport.convert(value, target); if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a " + target.getName()); } return rc; }  @SuppressWarnings("unchecked") static T convertPropertyTo(String name, Object value, Class<T> target); static void checkPropertyNameIsValid(String propertyName, boolean validateNames); static void checkIdentifierIsntLogicOperator(String identifier); static void checkIdentifierIsntNullTrueFalse(String identifier); static void checkIdentifierLetterAndDigitRequirements(String identifier); static void checkValidObject(Object value);  }### Answer:
@Test public void testConvertPropertyToNullBooleanTarget() throws JMSException { assertFalse(JMSMessagePropertySupport.convertPropertyTo("timeout", null, Boolean.class)); }
@Test(expected = NullPointerException.class) public void testConvertPropertyToNullFloatTarget() throws JMSException { JMSMessagePropertySupport.convertPropertyTo("float", null, Float.class); }
@Test(expected = NullPointerException.class) public void testConvertPropertyToNullDoubleTarget() throws JMSException { JMSMessagePropertySupport.convertPropertyTo("double", null, Double.class); }
@Test(expected = NumberFormatException.class) public void testConvertPropertyToNullShortTarget() throws JMSException { JMSMessagePropertySupport.convertPropertyTo("number", null, Short.class); }
@Test(expected = NumberFormatException.class) public void testConvertPropertyToNullIntegerTarget() throws JMSException { JMSMessagePropertySupport.convertPropertyTo("number", null, Integer.class); }
@Test(expected = NumberFormatException.class) public void testConvertPropertyToNullLongTarget() throws JMSException { JMSMessagePropertySupport.convertPropertyTo("number", null, Long.class); }
@Test public void testConvertPropertyToNullStringTarget() throws JMSException { assertNull(JMSMessagePropertySupport.convertPropertyTo("string", null, String.class)); }