I have a method `login()` which essentially sends a login request to a remote server. As I do not want to waste server resources on processing invalid data, I decided to consider sanity checking the input before I send it.

The code looks something this:

```
//Method to log user in
public void login(String username, String password) throws IOException{
    //If statement to sanity check credentials
    if (credentialsSanityCheck(username, password)) {
        //Perform login ...
    }
    else {
        throw new IllegalArgumentException("Invalid username/password");
    }
}

```

However, after learning more about the [Single Responsibilty Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle), I am now wondering if it is more appropriate to sanity check the method arguments from the calling code or within the method itself, as it's quite fuzzy (at least for me) to determine whether or not data validation falls under the method's responsibility.