[Demonstration 1]

[Buggy Method]
private String findSystemFunctor(String url, String name) {
    for (String loadPath : Loader.SYSTEM_LOAD_PATH) {
        File file = new File(loadPath, name);
        if (file.exists()) {
            return file.toString();
        }
    }
    throw new RuntimeException("Could not find system functor " + url);
}

[Buggy Hunk]
throw new RuntimeException("Could not find system functor " + url);

[Patch]
throw notFound(url);

[Demonstration 2]

[Buggy Method]
@Override
protected void process(AnnotatedElement annotatedElement) {
    Method method = (Method) annotatedElement;
    Class returnType = method.getReturnType();
    String returnClassName = returnType.getName();
    boolean singleObjectReturn = true;
    if (returnType.isArray() || Collection.class.isAssignableFrom(returnType)) {
        singleObjectReturn = false;
        returnClassName = determineGenericClass(method.getGenericReturnType().toString());
    }
    EntityDto entity = findEntityByClassName(returnClassName);
    if (entity == null) {
        LOGGER.error("There's no matching entity for the resolved return type of the lookup" + "method: {}; Resolved return type: {}", method.getName(), returnClassName);
        return;
    }
    LOGGER.debug("Found entity class by the return type of lookup method: {}", entity.getName());
    Lookup annotation = ReflectionsUtil.findAnnotation(method, Lookup.class);
    String lookupName = generateLookupName(annotation.name(), method.getName());
    List<LookupFieldDto> lookupFields = findLookupFields(method, entity);
    boolean restExposed = processRestExposed(method);
    boolean indexRequired = annotation.indexRequired();
    verifyLookupParameters(method, returnClassName, lookupName, lookupFields, method.getParameterTypes());
    LookupDto lookup = new LookupDto();
    lookup.setSingleObjectReturn(singleObjectReturn);
    lookup.setLookupName(lookupName);
    lookup.setLookupFields(lookupFields);
    lookup.setReadOnly(true);
    lookup.setMethodName(method.getName());
    lookup.setIndexRequired(indexRequired);
    if (!restOptionsModifiedByUser(entity)) {
        lookup.setExposedViaRest(restExposed);
    }
    if (!getElements().containsKey(returnClassName)) {
        put(returnClassName, new ArrayList<LookupDto>());
    }
    getElement(returnClassName).add(lookup);
}

[Buggy Hunk]
put(returnClassName, new ArrayList<LookupDto>());

[Patch]
put(returnClassName, new ArrayList<>());

[Demonstration 3]

[Buggy Method]
protected ResourceExecution createResourceExecution(final Method method, final UriInfoImpl uriInfo) {
    return new ResourceExecution(MessageBodyReaderWriterRegistry.createWithDefaults(), new ConstructorObjectFactory(), new Resource(method), uriInfo, requestMock, responseMock);
}

[Buggy Hunk]
protected ResourceExecution createResourceExecution(final Method method, final UriInfoImpl uriInfo) {

[Patch]
ResourceExecution createResourceExecution(final Method method, final UriInfoImpl uriInfo) {