3334353637383940
} @Test public void shouldReturnValueFromIdentityFunction() { String value = "some name"; Property property = new Property("attr", new IdentityFunction(value)); assertEquals(value, property.getValue()); }
4647484950515253
assertEquals(value, property.getValue()); } @Test public void shouldReturnNullFromIdentityFunction() { Property property = new Property("attr", new IdentityFunction(null)); assertEquals(null, property.getValue()); }
565758596061626364
this.properties.add(new Property(property, value)); } public void add(String property, Function function) { if (function == null) { function = new IdentityFunction(null); } this.properties.add(new Property(property, function)); }
24252627282930
this.name = name; this.function = function; } public Property(String name, Object value) { this(name, new IdentityFunction(value)); }