Skip to content

Java02. ДЗ 03, Shevchenko Ilya#4

Open
Qwsafex wants to merge 6 commits into
masterfrom
FunctionalJava
Open

Java02. ДЗ 03, Shevchenko Ilya#4
Qwsafex wants to merge 6 commits into
masterfrom
FunctionalJava

Conversation

@Qwsafex

@Qwsafex Qwsafex commented Oct 25, 2016

Copy link
Copy Markdown
Owner

No description provided.

@sproshev sproshev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо исправлять

/**
* Created by ilya on 10/24/16.
*/
public interface Function1<Return, Param> {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

то, что в дженерик параметрах сперва возвращаемое значение, а потом принимаемое, немного взрывает мозг )

*/
public interface Predicate<Param> extends Function1<Boolean, Param>{
Predicate ALWAYS_TRUE = x -> true;
Predicate ALWAYS_FALSE = x -> false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predicate<?> или Predicate<Object>

default Predicate<Param> and(Predicate<Param> g){
return param -> apply(param) && g.apply(param);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wildcard'ы?

return xw*xw;
}
}, array);
assertEquals(new ArrayList<Integer>(), mappedArray);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в качестве пустого списка можно использовать Collections.emptyList()

assertEquals(0, result);
}

} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо проверить, что поведение правой и левой свертки отличается

а также wildcard'ы

assertFalse(between3and5.apply(-1));
}

} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не проверяется ленивость

@Qwsafex

Qwsafex commented Dec 6, 2016

Copy link
Copy Markdown
Owner Author

@sproshev Поправил

@sproshev

Copy link
Copy Markdown

9.5, -0.5 за то, что тесты wildcard'ов так и не появились

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants