class AsynchronousProcessListWriter implements MessageBodyWriter<Iterable<AsynchronousProcess>> {

    @Override
    public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
        if (Iterable.class.isAssignableFrom(type) && (genericType instanceof ParameterizedType)) {
            Type[] types = ((ParameterizedType)genericType).getActualTypeArguments();
            return types.length == 1 && types[0] == AsynchronousProcess.class;
        }
        return false;
    }

}