[Demonstration 1]

[Buggy Method]
@GET
@Path("config/{packageName}/{artifact}")
public Response getPackageConfig(@PathParam("packageName") String packageName, @PathParam("artifact") String artifact) {
    if (StringUtils.isEmpty(packageName) || StringUtils.isEmpty(artifact)) {
        return new JsonResponse(Response.Status.BAD_REQUEST, "package name or artifact is empty").build();
    }
    try {
        Map<String, Map<String, Object>> config = helium.getPackageConfig(packageName, artifact);
        if (config == null) {
            return new JsonResponse(Response.Status.BAD_REQUEST, "Failed to find package for " + artifact).build();
        }
        return new JsonResponse(Response.Status.OK, config).build();
    } catch (RuntimeException e) {
        logger.error(e.getMessage(), e);
        return new JsonResponse(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
    }
}

[Buggy Hunk]
return new JsonResponse(Response.Status.OK, config).build();

[Patch]
return new JsonResponse<>(Response.Status.OK, config).build();

[Demonstration 2]

[Buggy Method]
@Override
public void updateState(Long orderId, Long staffId, String state, StatusDTO status) {
    OrderEntity order = commonDao.getOrder(orderId);
    if (null == orderId)
        throw new NoRecordFoundException("Invalid order id");
    SupplierStoreEntity store = storeDao.getStaffStore(staffId);
    if (store.getId().equals(order.getStore().getId()))
        throw new AccessDeniedException("User doesn't have permission to update status for this order. Order Id=" + orderId + " and User Id=" + staffId);
    /*switch (OrderState.valueOf(state)){
            case ORDER_INVOICE_GENERATED:
                order.setState(OrderState.ORDER_IN_PROCESS);
                ShippingEntity shipping = new ShippingEntity();

                break;
            case ORDER_PACKED:
                break;
            case ORDER_DISPATCHED:
                break;
            case ORDER_DELIVERED:
                break;
            case ORDER_DELIVERY_FAILED:
                break;
            default:
                status.setMessage("Invalid state");
                saveErrorMessage(status, HttpStatus.BAD_REQUEST.value());
                return;
        }*/
    order.setUpdatedAt(new Date());
    order.setStaff(UserEntity.getUser(staffId));
    order.setState(OrderState.valueOf(state));
    storeDao.save(order);
    Map<String, String> map = new HashMap<String, String>();
    map.put("orderNumber", order.getOrderNumber());
    this.taskExecutor.execute(this.asyncTask.getOrderNotificationTask(map));
    saveSuccessMessage(status, "Order State Updated");
}

[Buggy Hunk]
if(store.getId().equals(order.getStore().getId()))

[Patch]
if(!store.getId().equals(order.getStore().getId()))

[Demonstration 3]

[Buggy Method]
public Response replace(int index) {
    super.replace(index, "запас");
    return home();
}

[Buggy Hunk]
public Response replace(int index) {

[Patch]
public Response replace(int index) throws IOException {