Last active
July 16, 2019 16:10
-
-
Save ulisseslima/77481bd895f4e9008ce2254f8e2a0097 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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