Recently shared snippets by user "anonymous"

Arrays.asList(1,2,3,4).stream().mapToInt(i -> i.intValue()).sum();
Arrays.asList(1,2,3,4).stream().mapToInt(Integer::intValue).sum();
Arrays.asList(1,2,3,4).stream().collect(Collectors.summingInt(Integer::intValue));

// parallel streams
LongAdder a = new LongAdder();
Arrays.asList(1,2,3,4).parallelStream().forEach(a::add);
sum = a.intValue();


int sum = Arrays.asList(1,2,3,4).stream().reduce(0, (x,y) -> x+y)
Created 2 years ago by anonymous
http://www.defaultpassword.com/
http://www.defaultpassword.com/
Exceptiion while executing build 
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files

Sloution :
You need to look at the build.gradle. There may be something wrong with your configuration.
You may have misspelt something or may not have configured the plugins correctly.

My issues were with the annotationProcessor  not being configured properly.
Created 2 years ago by anonymous
private static String removeBetween(String string, String startChars, String endChars) {
		if(string.contains(startChars)&& string.contains(endChars)) {
			String substringAfter = StringUtils.substringAfterLast(string, startChars);
			String substringBefore = StringUtils.substringBefore(substringAfter, endChars);
			String finalStr = StringUtils.remove(string ,startChars + substringBefore+ endChars);
			string =removeBetween(finalStr, startChars, endChars);
		}
		return string;
	}