<commit_before>package pc.config;

import internet.InternetConnection;
import internet.InternetConnectionMock;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pc.PC;
import periphery.*;

@Configuration
public class PCConfig {

    @Bean
    public PC pc() {
        return new PC(internetConnection(), monitor(), keyboardAndMouse(), powerSupply());
    }

    @Bean
    public InternetConnection internetConnection() {
        return new InternetConnectionMock();
    }

    @Bean
    public Monitor monitor() {
        return new Monitor();
    }

    @Bean
    public PowerSupply powerSupply() {
        return new PowerSupply();
    }

    @Bean
    public KeyboardAndMouse keyboardAndMouse() {
        return new KeyboardAndMouse(keyboard(), mouse());
    }

    @Bean
    public Keyboard keyboard() {
        return new Keyboard();
    }

    @Bean
    public Mouse mouse() {
        return new Mouse();
    }
}<commit_msg>Used different versions of injecting dependencies. Also added some explonation.<commit_after>package pc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.mockito.Mockito.*;

import internet.InternetConnection;
import internet.InternetConnectionMock;
import pc.PC;
import periphery.*;

@Configuration
public class PCConfig {

    @Bean
    public PC pc() {
        return new PC(internetConnection(), monitor(), keyboardAndMouse(), powerSupply());
    }

    @Bean
    // injecting the 'actual' InternetConnectionMock (derived from the InternetConnection interface)
    public InternetConnection internetConnection() {
        return new InternetConnectionMock();
    }

    @Bean
    // injecting a Monitor that is working (default is not) even though Monitor is not an interface
    public Monitor monitor() {
        return new Monitor() {
            public boolean isWorking(){
                return true;
            }
        };
    }

    @Bean
    // injecting a mock of PowerSupply through mockito mock
    public PowerSupply powerSupply() {
        PowerSupply mockPowerSupply = mock(PowerSupply.class);
        // default behaviour is false for boolean functions
        when(mockPowerSupply.isOn()).thenReturn(true);
        return mockPowerSupply;
    }

    @Bean
    public KeyboardAndMouse keyboardAndMouse() {
        return new KeyboardAndMouse(keyboard(), mouse());
    }

    @Bean
    public Keyboard keyboard() {
        return new Keyboard();
    }

    @Bean
    public Mouse mouse() {
        return new Mouse();
    }
}
{'fraction_non_alphanumeric': 0.09028831562974203, 'fraction_numerical': 0.0, 'mean_word_length': 2.9594594594594597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5270630', 'n_tokens_mistral': 678, 'n_tokens_neox': 649, 'n_words': 202}