diff --git a/fork-choice-tests/src/integration-test/java/tech/pegasys/teku/forkChoiceTests/ForkChoiceIntegrationTest.java b/fork-choice-tests/src/integration-test/java/tech/pegasys/teku/forkChoiceTests/ForkChoiceIntegrationTest.java index 26f9b27e0e4..ec9cb09f9ce 100644 --- a/fork-choice-tests/src/integration-test/java/tech/pegasys/teku/forkChoiceTests/ForkChoiceIntegrationTest.java +++ b/fork-choice-tests/src/integration-test/java/tech/pegasys/teku/forkChoiceTests/ForkChoiceIntegrationTest.java @@ -145,10 +145,7 @@ private static Object extractTestStep( } private static ForkChoiceTestStep getStepKind(final Map ss) { - return ss.keySet().stream() - .map(ForkChoiceTestStep::valueOf) - .collect(Collectors.toList()) - .get(0); + return ss.keySet().stream().map(ForkChoiceTestStep::valueOf).toList().get(0); } private static T resolvePart( @@ -156,8 +153,7 @@ private static T resolvePart( final SszSchema type, final File testFile, final Object value) { - if (value instanceof String) { - String path = (String) value; + if (value instanceof String path) { if (path.endsWith(".yaml") || path.endsWith(".ssz")) { Path partPath = Paths.get(testFile.getParentFile().getParent(), "cache", path); try { @@ -225,9 +221,9 @@ void runForkChoiceTests( if (!processAttestation(forkChoice, (Attestation) step)) { attestationBuffer.add((Attestation) step); } - } else if (step instanceof Map) { + } else if (step instanceof Map rawChecks) { @SuppressWarnings("unchecked") - Map checks = (Map) step; + Map checks = (Map) rawChecks; for (Map.Entry e : checks.entrySet()) { String check = e.getKey(); switch (check) {