}
public static String MUTABLE_FIELD = "foo";
public @Test void testFieldTool() {
FieldTool fieldTool = (FieldTool)toolbox.get("field");
assertNotNull(fieldTool);
// read a constant from the configured included Class
assertEquals(Integer.MAX_VALUE, fieldTool.get("MAX_VALUE"));
// read a constant from java.lang.Boolean and make sure it is the same
assertSame(Boolean.TRUE, fieldTool.in("java.lang.Boolean").get("TRUE"));
// tell it to read constants from a non-existant class
// (which should return null)
assertNull(fieldTool.in("no.such.Class"));
// tell field tool to read constants from this instance's Class
// (which should NOT return null)
assertNotNull(fieldTool.in(this));
assertEquals(MUTABLE_FIELD, fieldTool.get("MUTABLE_FIELD"));
// grab the mutable field
String foo = MUTABLE_FIELD;
// change it
MUTABLE_FIELD = MUTABLE_FIELD + MUTABLE_FIELD;
// make sure it changed
assertFalse(foo.equals(MUTABLE_FIELD));
// make sure the fieldtool recognized that it changed
assertEquals(MUTABLE_FIELD, fieldTool.get("MUTABLE_FIELD"));
// pass a full field path to the get() method
assertEquals(Long.MIN_VALUE, fieldTool.get("java.lang.Long.MIN_VALUE"));
}