class ResponseImpl extends Response {

    @Override
    public Set<String> getAllowedMethods() {
        List<Object> allowedHeaders = getMetadata().get(ALLOW);
        if (allowedHeaders == null) {
            return Collections.emptySet();
        }
        Set<String> allowedMethods = new LinkedHashSet<>();
        for (Object allowMethod : allowedHeaders) {
            if (allowMethod instanceof String) {
                for (String s : ((String)allowMethod).split(",")) {
                    s = s.trim();
                    if (!s.isEmpty()) {
                        allowedMethods.add(s.toUpperCase());
                    }
                }
            } else if (allowMethod != null) {
                allowedMethods.add(getHeaderAsString(allowMethod).toUpperCase());
            }
        }
        return allowedMethods;
    }

    protected  ResponseImpl(int status, Object entity, Annotation[] entityAnnotations, MultivaluedMap<String, Object> headers);

}