Skip to content

Commit

Permalink
Cleanup - Simplify code using Java stream API
Browse files Browse the repository at this point in the history
  • Loading branch information
darxriggs committed Feb 14, 2019
1 parent 15abcbf commit 1f9c1cb
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/test/java/org/jvnet/hudson/test/TestExtensionTest.java
Expand Up @@ -23,6 +23,7 @@
*/
package org.jvnet.hudson.test;

import static java.util.stream.Collectors.toList;
import static org.junit.Assert.assertThat;

import java.util.List;
Expand All @@ -31,9 +32,6 @@
import org.junit.Rule;
import org.junit.Test;

import com.google.common.base.Function;
import com.google.common.collect.Lists;

import hudson.model.listeners.ItemListener;

/**
Expand All @@ -56,15 +54,7 @@ public static class MultipleTests extends ItemListener {
}

private List<Class<? extends ItemListener>> getExtensionClasses() {
return Lists.transform(
j.jenkins.getExtensionList(ItemListener.class),
new Function<ItemListener, Class<? extends ItemListener>>() {
@Override
public Class<? extends ItemListener> apply(ItemListener arg0) {
return arg0.getClass();
}
}
);
return j.jenkins.getExtensionList(ItemListener.class).stream().map(ItemListener::getClass).collect(toList());
}

@Test
Expand Down

0 comments on commit 1f9c1cb

Please sign in to comment.