minor formatting work

This commit is contained in:
eugenp
2016-12-05 11:50:57 +02:00
parent dcb7221d29
commit 9621327040
7 changed files with 56 additions and 101 deletions

View File

@@ -4,9 +4,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Building {
private static final Logger LOGGER = LoggerFactory.getLogger(Building.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Building.class);
public void paint() {
LOGGER.info("Painting Building");
}
public void paint() {
LOGGER.info("Painting Building");
}
}

View File

@@ -15,11 +15,9 @@ public class Generics {
// definition of a generic method
public static <T, G> List<G> fromArrayToList(T[] a, List<G> list, Function<T, G> mapperFunction) {
List<T> listWithTypeT = Arrays.stream(a).collect(Collectors.toList());
return listWithTypeT.stream().map(mapperFunction)
.collect(Collectors.toList());
return listWithTypeT.stream().map(mapperFunction).collect(Collectors.toList());
}
// example of a generic method that has Number as an upper bound for T
public static <T extends Number> List<T> fromArrayToListWithUpperBound(T[] a) {
return Arrays.stream(a).collect(Collectors.toList());