ViewableWriter implements MessageBodyWriter<Viewable> { @Override public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) { return aClass == Viewable.class; }  @Override boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType); @Override long getSize(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType); @Override void writeTo(Viewable viewable, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType,
                        MultivaluedMap<String, Object> headers, OutputStream out); static final String CONTENT_TYPE; static final Charset UTF8; }
@Test public void testIsWriteable() { ViewableWriter writer = new ViewableWriter(); assertFalse(writer.isWriteable(null, null, new Annotation[] {}, MediaType.WILDCARD_TYPE)); assertTrue(writer.isWriteable(Viewable.class, null, new Annotation[] {}, MediaType.WILDCARD_TYPE)); }