[Demonstration 1]

[Buggy Method]
private static Map<String, Class> createKeyMap() {
    Map<String, Class> map = new HashMap<>();
    map.put(SEARCH_INPUT_STRING, RxMessageString.class);
    map.put(SEARCH_RESULT_PAIR, RxMessageStopsAndDetails.class);
    map.put(SEARCH_RESULT_STOP, RxMessageStop.class);
    map.put(DESTINATION_SELECTED, RxMessageStopsAndDetails.class);
    map.put(SOURCE_SELECTED, RxMessageStopsAndDetails.class);
    map.put(SWITCH_SOURCE_DESTINATION_SELECTED, RxMessage.class);
    map.put(DATE_TIME_SELECTED, RxMessageStopsAndDetails.class);
    map.put(TRIP_SELECTED, RxMessagePossibleTrip.class);
    map.put(STOP_SELECTED, RxMessageStop.class);
    map.put(MY_LOCATION, RxMessageLocation.class);
    map.put(MY_LOCATION_UPDATE, RxMessageLocation.class);
    return Collections.unmodifiableMap(map);
}

[Buggy Hunk]
map.put(DATE_TIME_SELECTED, RxMessageStopsAndDetails.class);

[Patch]
map.put(DATE_TIME_SELECTED, RxMessageStopMethodAndDateTime.class);

[Demonstration 2]

[Buggy Method]
String dumpState() {
    StringBuilder sb = new StringBuilder();
    sb.append("CustomFragmentStack { ");
    for (Fragment f : fragments) {
        if (sb.length() > 1) {
            sb.append(", ");
        }
        sb.append(f.getClass().getCanonicalName());
        sb.append("@");
        sb.append(Integer.toHexString(System.identityHashCode(f)));
    }
    sb.append(" }");
    return sb.toString();
}

[Buggy Hunk]
if (sb.length() > 1) {

[Patch]
if (sb.length() > 22) {  // 22 is length of "CustomFragmentStack { "

[Demonstration 3]

[Buggy Method]
@Override
public void visit(Object obj) {
    if (!isVisited(obj))
        map.put(obj, map.size());
}

[Buggy Hunk]
map.put(obj, map.size());

[Patch]
list.add(obj);