Resource { public boolean isArray() { return value instanceof Resource[]; } 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 testIsArray() throws Exception { assertFalse("true is an array", RESOURCE_BOOLEAN.isArray()); assertFalse("test is an array", RESOURCE_STRING.isArray()); assertFalse("2.0 is an array", RESOURCE_FLOAT.isArray()); assertFalse("1 is an array", RESOURCE_INTEGER.isArray()); assertTrue("resource array is an array", RESOURCE_ARRAY.isArray()); }