@Test
public void validateOpaqueResourceFixedSize() throws Exception {

    ResourceModel binRes = createResourceModel(Type.OPAQUE, "{2}");
    assertFalse(binRes.isValid(new byte[1]));
    assertTrue(binRes.isValid(new byte[2]));
    assertFalse(binRes.isValid(new byte[3]));
    assertFalse(binRes.isValid(0));
    assertFalse(binRes.isValid(255));
    assertTrue(binRes.isValid(256));
    assertTrue(binRes.isValid(65535));
    assertFalse(binRes.isValid(65536));
    assertFalse(binRes.isValid((String) null));
    assertFalse(binRes.isValid(""));
    assertFalse(binRes.isValid("q"));
    assertTrue(binRes.isValid("up"));
    assertFalse(binRes.isValid("eos"));
}