Remove unused class
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 20 Jul 2015 04:51:55 +0000 (06:51 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 20 Jul 2015 04:52:00 +0000 (06:52 +0200)
src/main/java/net/pterodactylus/sone/utils/Optionals.java [deleted file]
src/test/java/net/pterodactylus/sone/utils/OptionalsTest.java [deleted file]

diff --git a/src/main/java/net/pterodactylus/sone/utils/Optionals.java b/src/main/java/net/pterodactylus/sone/utils/Optionals.java
deleted file mode 100644 (file)
index 67132aa..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package net.pterodactylus.sone.utils;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-
-/**
- * Helper methods for dealing with {@link Optional}s.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public class Optionals {
-
-       public static Predicate<Optional<?>> isPresent() {
-               return new Predicate<Optional<?>>() {
-                       @Override
-                       public boolean apply(Optional<?> input) {
-                               return input.isPresent();
-                       }
-               };
-       }
-
-       public static <T> Function<Optional<T>, T> get() {
-               return new Function<Optional<T>, T>() {
-                       @Override
-                       public T apply(Optional<T> input) {
-                               return input.get();
-                       }
-               };
-       }
-
-}
diff --git a/src/test/java/net/pterodactylus/sone/utils/OptionalsTest.java b/src/test/java/net/pterodactylus/sone/utils/OptionalsTest.java
deleted file mode 100644 (file)
index 0f7dee3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-package net.pterodactylus.sone.utils;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.FluentIterable;
-import org.hamcrest.MatcherAssert;
-import org.hamcrest.Matchers;
-import org.junit.Test;
-
-/**
- * Unit test for {@link Optionals}.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
- */
-public class OptionalsTest {
-
-       private final Object object1 = new Object();
-       private final Object object2 = new Object();
-       private final Object object3 = new Object();
-
-       @Test
-       public void canCreateOptionals() {
-               new Optionals();
-       }
-
-       @Test
-       public void isPresentFiltersCorrectOptionals() {
-               List<Optional<Object>> optionals = Arrays.asList(
-                               Optional.of(object1), Optional.absent(),
-                               Optional.of(object2), Optional.absent(),
-                               Optional.of(object3), Optional.absent()
-               );
-               List<Optional<Object>> filteredOptionals =
-                               FluentIterable.from(optionals).filter(Optionals.isPresent()).toList();
-               MatcherAssert.assertThat(filteredOptionals, Matchers.contains(
-                               Optional.of(object1), Optional.of(object2), Optional.of(object3)));
-       }
-
-       @Test
-       public void getReturnsCorrectValues() {
-               List<Optional<Object>> optionals = Arrays.asList(
-                               Optional.of(object1),
-                               Optional.of(object2),
-                               Optional.of(object3)
-               );
-               List<Object> objects = FluentIterable.from(optionals).transform(Optionals.get()).toList();
-               MatcherAssert.assertThat(objects, Matchers.contains(object1, object2, object3));
-       }
-
-}