[Demonstration 1]

[Buggy Method]
public Optional<V> putFront(K key, V value) {
    Optional<V> previous = get(key);
    DoublyLinkedList.Node<V> node = list.pushFront(value);
    map.put(key, node);
    return previous;
}

[Buggy Hunk]
Optional<V> previous = get(key);

[Patch]
Optional<V> previous = remove(key);

[Demonstration 2]

[Buggy Method]
@Override
public void postConstruct(Map<String, String> settings) {
    super.postConstruct(settings);
    try {
        namespace = getString(settings, SETTING_CW_NAMESPACE, null);
        // Configuring the CloudWatch client
        // Credentials are loaded from the Amazon EC2 Instance Metadata Service
        cloudWatchClient = new AmazonCloudWatchClient(new InstanceProfileCredentialsProvider());
        awsRegion = Region.getRegion(Regions.fromName(getRegion()));
        cloudWatchClient.setRegion(awsRegion);
        logger.log(getInfoLevel(), "CloudWatchOutputWriter is configured with Region " + awsRegion.toString() + ", namespace=" + namespace);
    } catch (IOException exc) {
        logger.log(Level.SEVERE, "Could not connect to AWS Metadata service", exc);
    }
}

[Buggy Hunk]
cloudWatchClient = new AmazonCloudWatchClient(new InstanceProfileCredentialsProvider());

[Patch]
cloudWatchClient = new AmazonCloudWatchClient(new DefaultAWSCredentialsProviderChain());

[Demonstration 3]

[Buggy Method]
@Override
public void write(final K key, final V value) {
    map.put(key, value);
}

[Buggy Hunk]
public void write(final K key, final V value) {

[Patch]
public final void write(final K key, final V value) {