From dfd8b0c4cc381b4090dfe22e8b4f6c38598a3987 Mon Sep 17 00:00:00 2001 From: Alex Theedom Date: Mon, 22 Aug 2016 19:31:23 +0100 Subject: [PATCH] Amend the test method names to include a when and remove unused throws --- .../src/test/java/com/baeldung/RandomListElementTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core-java-8/src/test/java/com/baeldung/RandomListElementTest.java b/core-java-8/src/test/java/com/baeldung/RandomListElementTest.java index 4f0ba466ea..8143da5794 100644 --- a/core-java-8/src/test/java/com/baeldung/RandomListElementTest.java +++ b/core-java-8/src/test/java/com/baeldung/RandomListElementTest.java @@ -9,10 +9,9 @@ import java.util.Random; public class RandomListElementTest { @Test - public void givenList_shouldReturnARandomElement1() throws Exception { + public void givenList_whenRandomNumberChosen_shouldReturnARandomElement() { List givenList = Arrays.asList(1, 2, 3); Random rand = new Random(); - - Integer result = givenList.get(rand.nextInt(givenList.size())); + givenList.get(rand.nextInt(givenList.size())); } }