class GroupsController {
    public static final String GROUPS_PATH = "groups";

    private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<String> listGroups() {
        if (env.hasGroups()) {
            return Objects.requireNonNull(env.getGroups()).values()
                    .stream()
                    .map(Group::getName)
                    .collect(Collectors.toList());
        } else {
            return Collections.emptyList();
        }
    }

    @GET
    @Path("/{group}/allprojects")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getAllProjectsForGroup(@PathParam("group") String groupName) {
        // Avoid classification as a taint bug.
        groupName = Laundromat.launderInput(groupName);
        Group group;
        group = Group.getByName(groupName);
        if (group == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        if (group.getAllProjects().isEmpty()) {
            return Response.ok().entity(Collections.emptyList()).build();
        } else {
            List<String> projectNameList = group.getAllProjects().stream().
                    map(Project::getName).collect(Collectors.toList());
            return Response.ok().entity(projectNameList).build();
        }
    }

    @GET
    @Path("/{group}/pattern")
    @Produces(MediaType.TEXT_PLAIN)
    public Response getPattern(@PathParam("group") String groupName) {
        // Avoid classification as a taint bug.
        groupName = Laundromat.launderInput(groupName);
        Group group;
        group = Group.getByName(groupName);
        if (group == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        return Response.ok().entity(group.getPattern()).build();
    }

    @POST
    @Consumes(MediaType.TEXT_PLAIN)
    @Path("/{group}/match")
    public Response matchProject(@PathParam("group") String groupName, String projectNameParam) {<FILL_FUNCTION_BODY>}
}

        // Avoid classification as a taint bug.
        final String projectName = Laundromat.launderInput(projectNameParam);

        // Avoid classification as a taint bug.
        groupName = Laundromat.launderInput(groupName);
        Group group;
        group = Group.getByName(groupName);
        if (group == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        if (group.match(projectName)) {
            return Response.ok().build();
        } else {
            return Response.status(Response.Status.NO_CONTENT).build();
        }
    
<no_super_class>