package edu.one.core.infra;

public class Utils {

	public static <T> T getOrElse(T value, T defaultValue) {
		return getOrElse(value, defaultValue, true);
	}

	public static <T> T getOrElse(T value, T defaultValue, boolean allowEmpty) {
		if (value != null && (allowEmpty || !value.toString().trim().isEmpty())) {
			return value;
		}
		return defaultValue;
	}

}

@@ -22,16 +22,71 @@
 infra;%0A%0A
+import java.io.InputStream;%0Aimport java.util.Scanner;%0A%0A
 public c
@@ -411,10 +411,212 @@
 ue;%0A%09%7D%0A%0A
+%09public static String inputStreamToString(InputStream in) %7B%0A%09%09Scanner scanner = new Scanner(in, %22UTF-8%22);%0A%09%09String content = scanner.useDelimiter(%22%5C%5CA%22).next();%0A%09%09scanner.close();%0A%09%09return content;%0A%09%7D%0A%0A
 %7D%0A

add util method to convert inputstream to String