WProperties extends Properties { public void putFloatProperty(String key, float value) { if (isKeyValid(key)) { this.put(key, String.valueOf(value)); } } WProperties(); @Override synchronized Object setProperty(String key, String value); @Override String getProperty(String key); void resetProperty(String key, String defaultValue); void resetServiceProperty(String key, String defaultValue); void putIntProperty(String key, int value); int getIntProperty(String key, int def); void putLongProperty(String key, long value); long getLongProperty(String key, long def); void putBooleanProperty(String key, boolean value); boolean getBooleanProperty(String key, boolean def); void putFloatProperty(String key, float value); float getFloatProperty(String key, float def); void putDoubleProperty(String key, double value); double getDoubleProperty(String key, double def); Color getColorProperty(String key); void putColorProperty(String key, Color color); void putByteArrayProperty(String key, byte[] value); byte[] getByteArrayProperty(String key, byte[] def); static String color2Hexadecimal(Color c, boolean alpha); static Color hexadecimal2Color(String hexColor); static void setProperty(WProperties properties, String key, Preferences prefNode, String defaultValue);  }
@Test public void testPutFloatProperty() { WProperties prop = new WProperties(); prop.putFloatProperty("float", Float.MAX_VALUE); Assert.assertEquals("different float", Float.MAX_VALUE, prop.getFloatProperty("float", 0.0f), 0.0f); prop.putFloatProperty("float", Float.NaN); Assert.assertEquals("different float", Float.NaN, prop.getFloatProperty("float", 0.0f), 0.0f); }