[Demonstration 1]

[Buggy Method]
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View v = inflater.inflate(R.layout.fragment_details, container, false);
    ImageView profpic = (ImageView) v.findViewById(R.id.imageView3);
    new ImageLoadTask((String) getArguments().get(ARG_URL), profpic).execute();
    TextView name = (TextView) v.findViewById(R.id.textView3);
    name.setText((String) getArguments().getString(ARG_NAME));
    TextView status = (TextView) v.findViewById(R.id.textView4);
    int statusInt = ((int) getArguments().getInt(ARG_STATUS));
    String[] stat = getResources().getStringArray(R.array.statuses);
    status.setText(stat[statusInt]);
    TextView age = (TextView) v.findViewById(R.id.textView6);
    String agee = (int) getArguments().getInt(ARG_AGE) + "";
    age.setText(agee);
    TextView gen = (TextView) v.findViewById(R.id.textView8);
    if ((int) getArguments().getInt(ARG_GENDER) == 1) {
        gen.setText("M");
    } else {
        gen.setText("F");
    }
    TextView inin = (TextView) v.findViewById(R.id.textView10);
    if ((int) getArguments().getInt(ARG_INTERESTED) == 1) {
        inin.setText("M");
    } else if ((int) getArguments().getInt(ARG_INTERESTED) == 2) {
        inin.setText("F");
    } else {
        inin.setText("BOTH");
    }
    return v;
}

[Buggy Hunk]
status.setText(stat[statusInt]);

[Patch]
status.setText(stat[statusInt-1]);

[Demonstration 2]

[Buggy Method]
private void createAdmin() {
    // Admin config
    Role adminrole = new Role("admin");
    roleRepository.save(adminrole);
    Collection<Role> roles = new ArrayList<>();
    roles.add(adminrole);
    Employee admin = new Employee("admin", bCryptPasswordEncoder.encode("default"), "sammi.fux@ordina.be", "Sammi", "Fux", "https://media.licdn.com/media/AAEAAQAAAAAAAAVgAAAAJDRjNGE2ZWVkLTM3NzEtNDNhZC1hMDdiLTI3NmU4MGU5Mzk0Zg.jpg", "0469696969", "JWORKS", "M", roles);
    employeeRepository.save(admin);
}

[Buggy Hunk]
Collection<Role> roles = new ArrayList<>();

[Patch]
List<Role> roles = new ArrayList<>();

[Demonstration 3]

[Buggy Method]
public void create(User user) throws Exception {
    if (userRepository.findByUsername(user.getUsername()) != null)
        throw new DuplicateKeyException("this account already exists");
    user.setPassword(new BCryptPasswordEncoder().encode(user.getPassword()));
    Role role = roleService.findByName("ROLE_USER");
    List<Role> roles = new ArrayList<Role>();
    roles.add(role);
    user.setRoles(roles);
    userRepository.save(user);
}

[Buggy Hunk]
Role role = roleService.findByName("ROLE_USER");

[Patch]
Role role = new Role("ROLE_USER");