Skip to content

Instantly share code, notes, and snippets.

Last active April 15, 2020 09:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Kod do wpisu o ciekawych zastosowaniach streamów w Javie. Post znajduje się pod adresem
public class Fibonacci {
private static class FibonacciGenerator {
private BigInteger nMinusTwo = BigInteger.ONE;
private BigInteger nMinusOne = BigInteger.ZERO;
public BigInteger next() {
final BigInteger n = nMinusTwo.add(nMinusOne);
nMinusTwo = nMinusOne;
nMinusOne = n;
return n;
public static void main(String[] args) {
BigInteger n = new BigInteger("10");
BigInteger result = Stream.generate(new FibonacciGenerator()::next)
String s1 = "przykładowy ciąg znaków";
Map<String, Long> map =""))
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment