AttributeEditor { @NonNull public AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, @Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String string) { if (isInvalidField(key) || isInvalidField(string)) { return this; } partialMutations.add(new PartialAttributeMutation(key, string)); return this; } AttributeEditor(@NonNull Clock clock); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key,
                                        @Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String string); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, int number); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, long number); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, float number); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, double number); @NonNull AttributeEditor setAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key, @NonNull Date date); @NonNull AttributeEditor removeAttribute(@Size(min = 1, max = MAX_ATTRIBUTE_FIELD_LENGTH) @NonNull String key); void apply();  }
@Test(expected = NumberFormatException.class) public void testDoubleNaN() throws NumberFormatException { editor.setAttribute("key", Double.NaN); }
@Test(expected = NumberFormatException.class) public void testDoublePositiveInfinity() throws NumberFormatException { editor.setAttribute("key", Double.POSITIVE_INFINITY); }
@Test(expected = NumberFormatException.class) public void testDoubleNegativeInfinity() throws NumberFormatException { editor.setAttribute("key", Double.NEGATIVE_INFINITY); }
@Test(expected = NumberFormatException.class) public void testFloatNaN() throws NumberFormatException { editor.setAttribute("key", Float.NaN); }
@Test(expected = NumberFormatException.class) public void testFloatPositiveInfinity() throws NumberFormatException { editor.setAttribute("key", Float.POSITIVE_INFINITY); }
@Test(expected = NumberFormatException.class) public void testFloatNegativeInfinity() throws NumberFormatException { editor.setAttribute("key", Float.NEGATIVE_INFINITY); }