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