private Set<MethodAndConsumedAndProducibleTypes> filterByAcceptHeader(
Set<MethodAndInputType> methodAndInputTypes,
AcceptHeader acceptHeader) {
Set<MethodAndConsumedAndProducibleTypes> result = new HashSet<MethodAndConsumedAndProducibleTypes>();
for (MethodAndInputType methodAndInputType : methodAndInputTypes) {
Produces produces = methodAndInputType.method
.getAnnotation(Produces.class);
Set<MediaType> producibleMediaTypes = new HashSet<MediaType>();
if (produces == null) {
// TODO look at class annotation
// */* is always acceptable
result.add(new MethodAndConsumedAndProducibleTypes(
methodAndInputType.method,
methodAndInputType.consumedType,
0,
producibleMediaTypes));
} else {
int bestQValue = 0;
for (String produced : produces.value()) {
MediaType producedType = MediaType.valueOf(produced);
int qValue = acceptHeader.getAcceptedQuality(producedType);
if (qValue == 0) {