### Question:
OAuthConfig { public boolean isValid() { boolean valid = !(Strings.isNullOrEmpty(authorizationBaseUrl) || Strings.isNullOrEmpty(loginBaseUrl) || Strings.isNullOrEmpty(clientId) || Strings.isNullOrEmpty(redirectUri) || scopes == null); if(!valid) { return false; } if(!usePKCE) { valid = !Strings.isNullOrEmpty(clientSecret); } return valid; }  boolean isValid(); String getScopes(); long getTokenExpiryBuffer();  }### Answer:
@Test public void testIsValid_whenAllParametersAreSet_shouldReturnTrue() { assertThat(createDefaultConfig().isValid()).isTrue(); assertThat(getDefaultBuilder().usePKCE(true).build().isValid()).isTrue(); }
@Test public void testIsValid_whenNotAllParametersAreNotSet_shouldReturnFalse() { assertThat(OAuthConfig.builder().build().isValid()).isFalse(); }