Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ulisseslima/77481bd895f4e9008ce2254f8e2a0097 to your computer and use it in GitHub Desktop.
Save ulisseslima/77481bd895f4e9008ce2254f8e2a0097 to your computer and use it in GitHub Desktop.
/**
* Fonte: https://www.youtube.com/watch?v=39HikyRBWA4
* @since 2019-07-11
* @author Dilma Rousseff
*/
public class DilmasSourceLegitimacyDefinitionAlgorithm {
public static void main(String[] args) {
String legitimacy = sourceLegitimacy(Boolean.valueOf(args[0]), Boolean.valueOf(args[1]));
System.out.println(legitimacy);
}
/**
* @param args
* @since 2019-07-11
* @author Dilma Rousseff
*/
public static String sourceLegitimacy(boolean leak, boolean noMatter) throws UnsupportedOperationException {
boolean wasHacker = false;
if (leak) {
wasHacker = true;
}
if (leak && wasHacker) {
noMatter = true;
}
if (leak && wasHacker && noMatter) {
throw new UnsupportedOperationException("o que fazer?");
}
if (leak && !noMatter) {
return "foi em nome do combate à corrupção!";
}
// falta definir, mas não deve chegar aqui, considerando as premissas
// super bem definidas acima.
throw new UnsupportedOperationException("o que fazer?");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment