Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Philippe
2019-01-29 21:23:16 -02:00
86 changed files with 1548 additions and 293 deletions
@@ -0,0 +1,29 @@
package com.baeldung.java8.lambda.methodreference;
public class Bicycle {
private String brand;
private Integer frameSize;
public Bicycle(String brand, Integer frameSize) {
this.brand = brand;
this.frameSize = frameSize;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public Integer getFrameSize() {
return frameSize;
}
public void setFrameSize(Integer frameSize) {
this.frameSize = frameSize;
}
}
@@ -0,0 +1,13 @@
package com.baeldung.java8.lambda.methodreference;
import java.util.Comparator;
public class BicycleComparator implements Comparator<Bicycle> {
@Override
public int compare(Bicycle a, Bicycle b) {
return a.getFrameSize()
.compareTo(b.getFrameSize());
}
}
@@ -0,0 +1,70 @@
package com.baeldung.java8.lambda.methodreference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiFunction;
import org.junit.Test;
public class MethodReferenceExamples {
private static <T> void doNothingAtAll(Object... o) {
}
;
@Test
public void referenceToStaticMethod() {
List<String> messages = Arrays.asList("Hello", "Baeldung", "readers!");
messages.forEach((word) -> {
System.out.println(word);
});
messages.forEach(System.out::println);
}
@Test
public void referenceToInstanceMethodOfParticularObject() {
BicycleComparator bikeFrameSizeComparator = new BicycleComparator();
createBicyclesList().stream()
.sorted((a, b) -> bikeFrameSizeComparator.compare(a, b));
createBicyclesList().stream()
.sorted(bikeFrameSizeComparator::compare);
}
@Test
public void referenceToInstanceMethodOfArbitratyObjectOfParticularType() {
List<Integer> numbers = Arrays.asList(5, 3, 50, 24, 40, 2, 9, 18);
numbers.stream()
.sorted((a, b) -> Integer.compare(a, b));
numbers.stream()
.sorted(Integer::compare);
}
@Test
public void referenceToConstructor() {
BiFunction<String, Integer, Bicycle> bikeCreator = (brand, frameSize) -> new Bicycle(brand, frameSize);
BiFunction<String, Integer, Bicycle> bikeCreatorMethodReference = Bicycle::new;
List<Bicycle> bikes = new ArrayList<>();
bikes.add(bikeCreator.apply("Giant", 50));
bikes.add(bikeCreator.apply("Scott", 20));
bikes.add(bikeCreatorMethodReference.apply("Trek", 35));
bikes.add(bikeCreatorMethodReference.apply("GT", 40));
}
@Test
public void limitationsAndAdditionalExamples() {
createBicyclesList().forEach(b -> System.out.printf("Bike brand is '%s' and frame size is '%d'%n", b.getBrand(), b.getFrameSize()));
createBicyclesList().forEach((o) -> this.doNothingAtAll(o));
}
private List<Bicycle> createBicyclesList() {
List<Bicycle> bikes = new ArrayList<>();
bikes.add(new Bicycle("Giant", 50));
bikes.add(new Bicycle("Scott", 20));
bikes.add(new Bicycle("Trek", 35));
bikes.add(new Bicycle("GT", 40));
return bikes;
}
}
@@ -0,0 +1,64 @@
package com.baeldung.files;
import java.io.File;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ListFiles {
public static final int DEPTH = 1;
public Set<String> listFilesUsingJavaIO(String dir) {
return Stream.of(new File(dir).listFiles())
.filter(file -> !file.isDirectory())
.map(File::getName)
.collect(Collectors.toSet());
}
public Set<String> listFilesUsingFileWalk(String dir, int depth) throws IOException {
try (Stream<Path> stream = Files.walk(Paths.get(dir), depth)) {
return stream.filter(file -> !Files.isDirectory(file))
.map(Path::getFileName)
.map(Path::toString)
.collect(Collectors.toSet());
}
}
public Set<String> listFilesUsingFileWalkAndVisitor(String dir) throws IOException {
Set<String> fileList = new HashSet<>();
Files.walkFileTree(Paths.get(dir), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (!Files.isDirectory(file)) {
fileList.add(file.getFileName()
.toString());
}
return FileVisitResult.CONTINUE;
}
});
return fileList;
}
public Set<String> listFilesUsingDirectoryStream(String dir) throws IOException {
Set<String> fileList = new HashSet<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(dir))) {
for (Path path : stream) {
if (!Files.isDirectory(path)) {
fileList.add(path.getFileName()
.toString());
}
}
}
return fileList;
}
}
@@ -0,0 +1,46 @@
package com.baeldung.file;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import com.baeldung.files.ListFiles;
public class ListFilesUnitTest {
private ListFiles listFiles = new ListFiles();
private String DIRECTORY = "src/test/resources/listFilesUnitTestFolder";
private static final int DEPTH = 1;
private Set<String> EXPECTED_FILE_LIST = new HashSet<String>() {
{
add("test.xml");
add("employee.json");
add("students.json");
add("country.txt");
}
};
@Test
public void givenDir_whenUsingJAVAIO_thenListAllFiles() throws IOException {
assertEquals(EXPECTED_FILE_LIST, listFiles.listFilesUsingJavaIO(DIRECTORY));
}
@Test
public void givenDir_whenWalkingTree_thenListAllFiles() throws IOException {
assertEquals(EXPECTED_FILE_LIST, listFiles.listFilesUsingFileWalk(DIRECTORY,DEPTH));
}
@Test
public void givenDir_whenWalkingTreeWithVisitor_thenListAllFiles() throws IOException {
assertEquals(EXPECTED_FILE_LIST, listFiles.listFilesUsingFileWalkAndVisitor(DIRECTORY));
}
@Test
public void givenDir_whenUsingDirectoryStream_thenListAllFiles() throws IOException {
assertEquals(EXPECTED_FILE_LIST, listFiles.listFilesUsingDirectoryStream(DIRECTORY));
}
}
@@ -0,0 +1 @@
This is a sample txt file for unit test ListFilesUnitTest
@@ -0,0 +1 @@
<xml></xml>
@@ -0,0 +1,14 @@
package org.baeldung.variable.scope.examples;
public class BracketScopeExample {
public void mathOperationExample() {
Integer sum = 0;
{
Integer number = 2;
sum = sum + number;
}
// compiler error, number cannot be solved as a variable
// number++;
}
}
@@ -0,0 +1,14 @@
package org.baeldung.variable.scope.examples;
public class ClassScopeExample {
Integer amount = 0;
public void exampleMethod() {
amount++;
}
public void anotherExampleMethod() {
Integer anotherAmount = amount + 4;
}
}
@@ -0,0 +1,18 @@
package org.baeldung.variable.scope.examples;
import java.util.Arrays;
import java.util.List;
public class LoopScopeExample {
List<String> listOfNames = Arrays.asList("Joe", "Susan", "Pattrick");
public void iterationOfNames() {
String allNames = "";
for (String name : listOfNames) {
allNames = allNames + " " + name;
}
// compiler error, name cannot be resolved to a variable
// String lastNameUsed = name;
}
}
@@ -0,0 +1,13 @@
package org.baeldung.variable.scope.examples;
public class MethodScopeExample {
public void methodA() {
Integer area = 2;
}
public void methodB() {
// compiler error, area cannot be resolved to a variable
// area = area + 2;
}
}
@@ -0,0 +1,12 @@
package org.baeldung.variable.scope.examples;
public class NestedScopesExample {
String title = "Baeldung";
public void printTitle() {
System.out.println(title);
String title = "John Doe";
System.out.println(title);
}
}
@@ -10,7 +10,7 @@ public class BitwiseOperatorUnitTest {
int value1 = 6;
int value2 = 5;
int result = value1 & value2;
assertEquals(result, 4);
assertEquals(4, result);
}
@Test
@@ -18,7 +18,7 @@ public class BitwiseOperatorUnitTest {
int value1 = 6;
int value2 = 5;
int result = value1 | value2;
assertEquals(result, 7);
assertEquals(7, result);
}
@Test
@@ -26,7 +26,7 @@ public class BitwiseOperatorUnitTest {
int value1 = 6;
int value2 = 5;
int result = value1 ^ value2;
assertEquals(result, 3);
assertEquals(3, result);
}
@Test
@@ -40,42 +40,42 @@ public class BitwiseOperatorUnitTest {
public void givenOnePositiveInteger_whenSignedRightShiftOperator_thenNewDecimalNumber() {
int value = 12;
int rightShift = value >> 2;
assertEquals(rightShift, 3);
assertEquals(3, rightShift);
}
@Test
public void givenOneNegativeInteger_whenSignedRightShiftOperator_thenNewDecimalNumber() {
int value = -12;
int rightShift = value >> 2;
assertEquals(rightShift, -3);
assertEquals(-3, rightShift);
}
@Test
public void givenOnePositiveInteger_whenLeftShiftOperator_thenNewDecimalNumber() {
int value = 12;
int leftShift = value << 2;
assertEquals(leftShift, 48);
assertEquals(48, leftShift);
}
@Test
public void givenOneNegativeInteger_whenLeftShiftOperator_thenNewDecimalNumber() {
int value = -12;
int leftShift = value << 2;
assertEquals(leftShift, -48);
assertEquals(-48, leftShift);
}
@Test
public void givenOnePositiveInteger_whenUnsignedRightShiftOperator_thenNewDecimalNumber() {
int value = 12;
int unsignedRightShift = value >>> 2;
assertEquals(unsignedRightShift, 3);
assertEquals(3, unsignedRightShift);
}
@Test
public void givenOneNegativeInteger_whenUnsignedRightShiftOperator_thenNewDecimalNumber() {
int value = -12;
int unsignedRightShift = value >>> 2;
assertEquals(unsignedRightShift, 1073741821);
assertEquals(1073741821, unsignedRightShift);
}
}
@@ -6,7 +6,19 @@ import kotlin.test.assertTrue
class VoidTypesUnitTest {
fun returnTypeAsVoid(): Void? {
// Un-commenting below methods will result into compilation error
// as the syntax used is incorrect and is used for explanation in tutorial.
// fun returnTypeAsVoidAttempt1(): Void {
// println("Trying with Void as return type")
// }
// fun returnTypeAsVoidAttempt2(): Void {
// println("Trying with Void as return type")
// return null
// }
fun returnTypeAsVoidSuccess(): Void? {
println("Function can have Void as return type")
return null
}
@@ -36,7 +48,7 @@ class VoidTypesUnitTest {
@Test
fun givenVoidReturnType_thenReturnsNullOnly() {
assertNull(returnTypeAsVoid())
assertNull(returnTypeAsVoidSuccess())
}
@Test
@@ -0,0 +1,204 @@
package com.baeldung.java.map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.collections4.MultiMapUtils;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
import org.junit.Test;
public class MultiValuedMapUnitTest {
@Test
public void givenMultiValuesMap_whenPuttingMultipleValuesUsingPutMethod_thenReturningAllValues() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value1");
map.put("key", "value2");
map.put("key", "value2");
assertThat((Collection<String>) map.get("key")).containsExactly("value1", "value2", "value2");
}
@Test
public void givenMultiValuesMap_whenPuttingMultipleValuesUsingPutAllMethod_thenReturningAllValues() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.putAll("key", Arrays.asList("value1", "value2", "value2"));
assertThat((Collection<String>) map.get("key")).containsExactly("value1", "value2", "value2");
}
@Test
public void givenMultiValuesMap_whenGettingValueUsingGetMethod_thenReturningValue() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
assertThat((Collection<String>) map.get("key")).containsExactly("value");
}
@Test
public void givenMultiValuesMap_whenUsingEntriesMethod_thenReturningMappings() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value1");
map.put("key", "value2");
Collection<Entry<String, String>> entries = (Collection<Entry<String, String>>) map.entries();
for(Map.Entry<String,String> entry : entries) {
assertThat(entry.getKey()).contains("key");
assertTrue(entry.getValue().equals("value1") || entry.getValue().equals("value2") );
}
}
@Test
public void givenMultiValuesMap_whenUsingKeysMethod_thenReturningAllKeys() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat(((Collection<String>) map.keys())).contains("key", "key1", "key2");
}
@Test
public void givenMultiValuesMap_whenUsingKeySetMethod_thenReturningAllKeys() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat((Collection<String>) map.keySet()).contains("key", "key1", "key2");
}
@Test
public void givenMultiValuesMap_whenUsingValuesMethod_thenReturningAllValues() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat(((Collection<String>) map.values())).contains("value", "value1", "value2");
}
@Test
public void givenMultiValuesMap_whenUsingRemoveMethod_thenReturningUpdatedMap() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat(((Collection<String>) map.values())).contains("value", "value1", "value2");
map.remove("key");
assertThat(((Collection<String>) map.values())).contains("value1", "value2");
}
@Test
public void givenMultiValuesMap_whenUsingRemoveMappingMethod_thenReturningUpdatedMapAfterMappingRemoved() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat(((Collection<String>) map.values())).contains("value", "value1", "value2");
map.removeMapping("key", "value");
assertThat(((Collection<String>) map.values())).contains("value1", "value2");
}
@Test
public void givenMultiValuesMap_whenUsingClearMethod_thenReturningEmptyMap() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertThat(((Collection<String>) map.values())).contains("value", "value1", "value2");
map.clear();
assertTrue(map.isEmpty());
}
@Test
public void givenMultiValuesMap_whenUsingContainsKeyMethod_thenReturningTrue() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertTrue(map.containsKey("key"));
}
@Test
public void givenMultiValuesMap_whenUsingContainsValueMethod_thenReturningTrue() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertTrue(map.containsValue("value"));
}
@Test
public void givenMultiValuesMap_whenUsingIsEmptyMethod_thenReturningFalse() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertFalse(map.isEmpty());
}
@Test
public void givenMultiValuesMap_whenUsingSizeMethod_thenReturningElementCount() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value");
map.put("key1", "value1");
map.put("key2", "value2");
assertEquals(3, map.size());
}
@Test
public void givenArrayListValuedHashMap_whenPuttingDoubleValues_thenReturningAllValues() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value1");
map.put("key", "value2");
map.put("key", "value2");
assertThat((Collection<String>) map.get("key")).containsExactly("value1", "value2", "value2");
}
@Test
public void givenHashSetValuedHashMap_whenPuttingTwiceTheSame_thenReturningOneValue() {
MultiValuedMap<String, String> map = new HashSetValuedHashMap<>();
map.put("key1", "value1");
map.put("key1", "value1");
assertThat((Collection<String>) map.get("key1")).containsExactly("value1");
}
@Test(expected = UnsupportedOperationException.class)
public void givenUnmodifiableMultiValuedMap_whenInserting_thenThrowingException() {
MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
map.put("key", "value1");
map.put("key", "value2");
MultiValuedMap<String, String> immutableMap = MultiMapUtils.unmodifiableMultiValuedMap(map);
immutableMap.put("key", "value3");
}
}
+6
View File
@@ -95,6 +95,12 @@
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.ahocorasick</groupId>
<artifactId>ahocorasick</artifactId>
<version>0.4.0</version>
</dependency>
</dependencies>
<build>
@@ -0,0 +1,83 @@
package com.baeldung.string;
import org.ahocorasick.trie.Emit;
import org.ahocorasick.trie.Token;
import org.ahocorasick.trie.Trie;
import java.util.*;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class MatchWords {
public static boolean containsWordsIndexOf(String inputString, String[] words) {
boolean found = true;
for (String word : words) {
if (inputString.indexOf(word) == -1) {
found = false;
break;
}
}
return found;
}
public static boolean containsWords(String inputString, String[] items) {
boolean found = true;
for (String item : items) {
if (!inputString.contains(item)) {
found = false;
break;
}
}
return found;
}
public static boolean containsWordsAhoCorasick(String inputString, String[] words) {
Trie trie = Trie.builder()
.onlyWholeWords()
.addKeywords(words)
.build();
Collection<Emit> emits = trie.parseText(inputString);
emits.forEach(System.out::println);
boolean found = true;
for(String word : words) {
boolean contains = Arrays.toString(emits.toArray()).contains(word);
if (!contains) {
found = false;
break;
}
}
return found;
}
public static boolean containsWordsPatternMatch(String inputString, String[] words) {
StringBuilder regexp = new StringBuilder();
for (String word : words) {
regexp.append("(?=.*").append(word).append(")");
}
Pattern pattern = Pattern.compile(regexp.toString());
return pattern.matcher(inputString).find();
}
public static boolean containsWordsJava8(String inputString, String[] words) {
List<String> inputStringList = Arrays.asList(inputString.split(" "));
List<String> wordsList = Arrays.asList(words);
return wordsList.stream().allMatch(inputStringList::contains);
}
public static boolean containsWordsArray(String inputString, String[] words) {
List<String> inputStringList = Arrays.asList(inputString.split(" "));
List<String> wordsList = Arrays.asList(words);
return inputStringList.containsAll(wordsList);
}
}
@@ -0,0 +1,66 @@
package com.baeldung.string;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class MatchWordsUnitTest {
private final String[] words = {"hello", "Baeldung"};
private final String inputString = "hello there, Baeldung";
private final String wholeInput = "helloBaeldung";
@Test
public void givenText_whenCallingStringContains_shouldMatchWords() {
final boolean result = MatchWords.containsWords(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingJava8_shouldMatchWords() {
final boolean result = MatchWords.containsWordsJava8(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingJava8_shouldNotMatchWords() {
final boolean result = MatchWords.containsWordsJava8(wholeInput, words);
assertThat(result).isFalse();
}
@Test
public void givenText_whenCallingPattern_shouldMatchWords() {
final boolean result = MatchWords.containsWordsPatternMatch(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingAhoCorasick_shouldMatchWords() {
final boolean result = MatchWords.containsWordsAhoCorasick(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingAhoCorasick_shouldNotMatchWords() {
final boolean result = MatchWords.containsWordsAhoCorasick(wholeInput, words);
assertThat(result).isFalse();
}
@Test
public void givenText_whenCallingIndexOf_shouldMatchWords() {
final boolean result = MatchWords.containsWordsIndexOf(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingArrayList_shouldMatchWords() {
final boolean result = MatchWords.containsWordsArray(inputString, words);
assertThat(result).isTrue();
}
@Test
public void givenText_whenCallingArrayList_shouldNotMatchWords() {
final boolean result = MatchWords.containsWordsArray(wholeInput, words);
assertThat(result).isFalse();
}
}
+2
View File
@@ -5,3 +5,5 @@
- [Lombok @Builder with Inheritance](https://www.baeldung.com/lombok-builder-inheritance)
- [Lombok Builder with Default Value](https://www.baeldung.com/lombok-builder-default-value)
- [Lombok Builder with Custom Setter](https://www.baeldung.com/lombok-builder-custom-setter)
- [Setting up Lombok with Eclipse and Intellij](https://www.baeldung.com/lombok-ide)
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId>
<artifactId>solid/artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,4 @@
package com.baeldung.d;
public class Keyboard {
}
@@ -0,0 +1,6 @@
package com.baeldung.d;
public class Monitor {
}
@@ -0,0 +1,15 @@
package com.baeldung.d;
public class Windows98Machine {
private final Keyboard keyboard;
private final Monitor monitor;
public Windows98Machine() {
monitor = new Monitor();
keyboard = new Keyboard();
}
}
@@ -0,0 +1,12 @@
package com.baeldung.d;
public class Windows98MachineDI {
private final Keyboard keyboard;
private final Monitor monitor;
public Windows98MachineDI(Keyboard keyboard, Monitor monitor) {
this.keyboard = keyboard;
this.monitor = monitor;
}
}
@@ -0,0 +1,12 @@
package com.baeldung.i;
public class BearCarer implements BearCleaner, BearFeeder {
public void washTheBear() {
//I think we missed a spot..
}
public void feedTheBear() {
//Tuna tuesdays..
}
}
@@ -0,0 +1,5 @@
package com.baeldung.i;
public interface BearCleaner {
void washTheBear();
}
@@ -0,0 +1,5 @@
package com.baeldung.i;
public interface BearFeeder {
void feedTheBear();
}
@@ -0,0 +1,9 @@
package com.baeldung.i;
public interface BearKeeper {
void washTheBear();
void feedTheBear();
void petTheBear();
}

Some files were not shown because too many files have changed in this diff Show More