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