Resource { public boolean isNumber() { return value instanceof Number; } Resource(Boolean value);  Resource(Number value);  Resource(String value);  Resource(Resource[] value); boolean isBoolean(); boolean isNumber(); boolean isString(); boolean isArray(); boolean getAsBoolean(); @Nullable String getAsString(); @Nullable Float getAsFloat(); @Nullable Integer getAsInt(); int[] getAsIntegerArray(); @NonNull String[] getAsStringArray();  }
@Test public void testIsNumber() throws Exception { assertFalse("true is a number", RESOURCE_BOOLEAN.isNumber()); assertFalse("test is a number", RESOURCE_STRING.isNumber()); assertTrue("2.0 is a number", RESOURCE_FLOAT.isNumber()); assertTrue("1 is a number", RESOURCE_INTEGER.isNumber()); assertFalse("resource array is an number", RESOURCE_ARRAY.isNumber()); }