src/main/java/org/varjoinen/testing/varjoend/Process.java
private void validate() throws ProcessIntegrityException {
        if (steps == null || steps.isEmpty()) {
            throw new ProcessIntegrityException("Process has no steps");
        }

        if (steps.stream().anyMatch(Objects::isNull)) {
            throw new ProcessIntegrityException("Steps contain null(s)");
        }

        Set<Step> duplicates = steps
                .stream()
                .filter(s1 -> steps.stream().filter(s1::equals).count() > 1)
                .collect(Collectors.toSet());

        if (duplicates.size() > 0) {
            throw new ProcessIntegrityException(String.format(
                    "There are multiple steps with the same name: %s",
                    duplicates));
        }
    }
/**
     * Validate steps
     *
     * @throws ProcessIntegrityException If integrity has failed
     */
Validate steps
@throws ProcessIntegrityException If integrity has failed
Validate steps @throws ProcessIntegrityException If integrity has failed
private void validate() throws ProcessIntegrityException {
        if (steps == null || steps.isEmpty()) {
            throw new ProcessIntegrityException("Process has no steps");
        }
        if (steps.stream().anyMatch(Objects::isNull)) {
            throw new ProcessIntegrityException("Steps contain null(s)");
        }
        Set<Step> duplicates = steps
                .stream()
                .filter(s1 -> steps.stream().filter(s1::equals).count() > 1)
                .collect(Collectors.toSet());
        if (duplicates.size() > 0) {
            throw new ProcessIntegrityException(String.format(
                    "There are multiple steps with the same name: %s",
                    duplicates));
        }
    }
private void validate ( ) throws ProcessIntegrityException { if ( steps == null || steps . isEmpty ( ) ) { throw new ProcessIntegrityException ( "Process has no steps" ) ; } if ( steps . stream ( ) . anyMatch ( Objects :: isNull ) ) { throw new ProcessIntegrityException ( "Steps contain null(s)" ) ; } Set < Step > duplicates = steps . stream ( ) . filter ( s1 -> steps . stream ( ) . filter ( s1 :: equals ) . count ( ) > 1 ) . collect ( Collectors . toSet ( ) ) ; if ( duplicates . size ( ) > 0 ) { throw new ProcessIntegrityException ( String . format ( "There are multiple steps with the same name: %s" , duplicates ) ) ; } }
Validate steps
 @throws ProcessIntegrityException If integrity has failed
Validate steps @throws ProcessIntegrityException If integrity has failed